Skip to content

Commit

Permalink
temp: update model remove worker endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
muhammed-shihebi committed May 1, 2024
1 parent 0e44372 commit 270fbae
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 3 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build-and-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
"model-manager",
"model-inference-transformer",
"model-inference-onnx",
# "model-inference-sentence-transformer",
"model-inference-sentence-transformer",
"model-inference-graph-transformer",
"skill-manager",
"skill-boolq",
Expand All @@ -48,7 +48,7 @@ jobs:
"skill-multiple-choice-metaqa",
"skill-kgqa-kqapro",
"evaluator",
# "sensitivity",
"sensitivity",
]
include:
- build-args: ""
Expand Down
10 changes: 10 additions & 0 deletions datastore-api/app/core/model_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,16 @@ async def predict(self, model_identifier, prediction_method, input_data):
logger.debug(f"Request data: {input_data}")
logger.debug(f"URL is: {self.square_api_url}/main/{model_identifier}/{prediction_method}")


# # check if the model is available
# req_result = requests.get(
# f"{self.base_url}/{model_identifier}/health/heartbeat",
# headers={"Authorization": f"Bearer {client_credentials()}"}
# )




my_conn = aiohttp.TCPConnector()
async with aiohttp.ClientSession(connector=my_conn) as session:
async with session.post(
Expand Down
8 changes: 7 additions & 1 deletion model-manager/model_manager/app/routers/management.py
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,13 @@ async def add_model_container(request: Request, identifier: str, num: int):


@router.delete("/{identifier}/remove_worker/{num}")
async def remove_model_container(request: Request, identifier: str, num: int):
@router.delete("/{hf_username}/{identifier}/remove_worker/{num}")
async def remove_model_container(
request: Request,
identifier: str,
num: int,
hf_username: str = None
):
"""
Remove a model worker from the platform
"""
Expand Down

0 comments on commit 270fbae

Please sign in to comment.