Timothy J. Baek 11 月之前
父节点
当前提交
0a48114bd2
共有 1 个文件被更改,包括 8 次插入1 次删除
  1. 8 1
      backend/main.py

+ 8 - 1
backend/main.py

@@ -312,13 +312,20 @@ async def get_models(user=Depends(get_verified_user)):
                     model["name"] = custom_model.name
                     model["name"] = custom_model.name
                     model["info"] = custom_model.model_dump()
                     model["info"] = custom_model.model_dump()
         else:
         else:
+
+            owned_by = "openai"
+            for model in models:
+                if custom_model.base_model_id == model["id"]:
+                    owned_by = model["owned_by"]
+                    break
+
             models.append(
             models.append(
                 {
                 {
                     "id": custom_model.id,
                     "id": custom_model.id,
                     "name": custom_model.name,
                     "name": custom_model.name,
                     "object": "model",
                     "object": "model",
                     "created": custom_model.created_at,
                     "created": custom_model.created_at,
-                    "owned_by": "user",
+                    "owned_by": owned_by,
                     "info": custom_model.model_dump(),
                     "info": custom_model.model_dump(),
                 }
                 }
             )
             )