fix: model list hide issue

This commit is contained in:
Timothy Jaeryang Baek 2025-04-12 18:34:10 -07:00
parent d5ee39de21
commit daabc188e8

View File

@ -114,9 +114,12 @@ async def get_all_models(request, user: UserModel = None):
for custom_model in custom_models:
if custom_model.base_model_id is None:
for model in models:
if (
custom_model.id == model["id"]
or custom_model.id == model["id"].split(":")[0]
if custom_model.id == model["id"] or (
model.get("owned_by") == "ollama"
and custom_model.id
== model["id"].split(":")[
0
] # Ollama may return model ids in different formats (e.g., 'llama3' vs. 'llama3:7b')
):
if custom_model.is_active:
model["name"] = custom_model.name