mirror of
https://github.com/theroyallab/tabbyAPI.git
synced 2026-04-20 06:19:15 +00:00
OAI: Add cancellation with inline load
When the request is cancelled, cancel the load task. In addition, when checking if a model container exists, also check if the model is fully loaded. Signed-off-by: kingbri <bdashore3@proton.me>
This commit is contained in:
@@ -112,8 +112,12 @@ async def _stream_collector(
|
||||
async def load_inline_model(model_name: str, request: Request):
|
||||
"""Load a model from the data.model parameter"""
|
||||
|
||||
# Return if the model container already exists
|
||||
if model.container and model.container.model_dir.name == model_name:
|
||||
# Return if the model container already exists and the model is fully loaded
|
||||
if (
|
||||
model.container
|
||||
and model.container.model_dir.name == model_name
|
||||
and model.container.model_loaded
|
||||
):
|
||||
return
|
||||
|
||||
# Inline model loading isn't enabled or the user isn't an admin
|
||||
|
||||
Reference in New Issue
Block a user