فهرست منبع

refac/fix: model name retrieval edge case

Timothy Jaeryang Baek 1 ماه پیش
والد
کامیت
2387877dae
1فایلهای تغییر یافته به همراه2 افزوده شده و 2 حذف شده
  1. 2 2
      backend/open_webui/main.py

+ 2 - 2
backend/open_webui/main.py

@@ -1324,8 +1324,8 @@ async def get_models(
         # Sort models by order list priority, with fallback for those not in the list
         models.sort(
             key=lambda model: (
-                model_order_dict.get(model.get("id"), float("inf")),
-                model.get("name"),
+                model_order_dict.get(model.get("id", ""), float("inf")),
+                (model.get("name", "") or ""),
             )
         )