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:
parent
4bf1a71d7b
commit
8854269121
1 changed files with 6 additions and 3 deletions
|
|
@ -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))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue