mirror of
https://github.com/theroyallab/tabbyAPI.git
synced 2026-03-14 15:57:27 +00:00
API: Fix current model list return
Check if the container actually exists in the match before returning the value of the directory. Signed-off-by: kingbri <bdashore3@proton.me>
This commit is contained in:
@@ -45,11 +45,14 @@ async def get_current_model_list(model_type: str = "model"):
|
||||
# Make sure the model container exists
|
||||
match model_type:
|
||||
case "model":
|
||||
model_path = model.container.model_dir
|
||||
if model.container:
|
||||
model_path = model.container.model_dir
|
||||
case "draft":
|
||||
model_path = model.container.draft_model_dir
|
||||
if model.container:
|
||||
model_path = model.container.draft_model_dir
|
||||
case "embedding":
|
||||
model_path = model.embeddings_container.model_dir
|
||||
if model.embeddings_container:
|
||||
model_path = model.embeddings_container.model_dir
|
||||
|
||||
if model_path:
|
||||
current_models.append(ModelCard(id=model_path.name))
|
||||
|
||||
Reference in New Issue
Block a user