Skip to content

Commit

Permalink
feat(loadModel): send loadModel status
Browse files Browse the repository at this point in the history
  • Loading branch information
gadicc committed May 20, 2023
1 parent c309ca9 commit db75740
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion api/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,13 +229,20 @@ def sendStatus():
clearPipelines()
if model:
model.to("cpu") # Necessary to avoid a memory leak
model = loadModel(
await send(
"loadModel", "start", {"startRequestId": startRequestId}, send_opts
)
model = await asyncio.to_thread(
loadModel,
model_id=normalized_model_id,
load=True,
precision=model_precision,
revision=model_revision,
send_opts=send_opts,
)
await send(
"loadModel", "done", {"startRequestId": startRequestId}, send_opts
)
last_model_id = normalized_model_id
else:
if always_normalize_model_id:
Expand Down

0 comments on commit db75740

Please sign in to comment.