fix: image model ranking crashes on a non-string search filter (#1898)

This commit is contained in:
Afonso Coutinho
2026-06-04 03:26:35 +01:00
committed by GitHub
parent 5043b2924c
commit 03dbf976a5
2 changed files with 16 additions and 1 deletions
+1 -1
View File
@@ -288,7 +288,7 @@ def rank_image_models(system, search=None, sort="fit"):
for model in IMAGE_MODEL_REGISTRY:
# Filter by search
if search:
if isinstance(search, str) and search:
s = search.lower()
if s not in model["name"].lower() and s not in model["id"].lower() and s not in model.get("description", "").lower():
continue