feat: unified /models endpoint

This commit is contained in:
Timothy J. Baek
2024-05-24 01:40:48 -07:00
parent 4d57e08b38
commit 110ed67468
16 changed files with 166 additions and 170 deletions

View File

@@ -242,8 +242,6 @@ async def get_models(user=Depends(get_current_user)):
)
)
for model in data["data"]:
add_custom_info_to_model(model)
return data
except Exception as e:
@@ -284,12 +282,6 @@ async def get_models(user=Depends(get_current_user)):
}
def add_custom_info_to_model(model: dict):
model["custom_info"] = next(
(item for item in app.state.MODEL_CONFIG if item.id == model["id"]), None
)
@app.get("/model/info")
async def get_model_list(user=Depends(get_admin_user)):
return {"data": app.state.CONFIG["model_list"]}