This commit is contained in:
Timothy Jaeryang Baek
2024-11-15 03:00:18 -08:00
parent bf2087c67b
commit a0f1164af7
8 changed files with 66 additions and 66 deletions

View File

@@ -522,8 +522,11 @@ async def generate_chat_completion(
payload = apply_model_params_to_body_openai(params, payload)
payload = apply_model_system_prompt_to_body(params, payload, user)
model = app.state.MODELS[payload.get("model")]
idx = model["urlIdx"]
try:
model = app.state.MODELS[payload.get("model")]
idx = model["urlIdx"]
except Exception as e:
raise HTTPException(status_code=404, detail="Model not found")
api_config = app.state.config.OPENAI_API_CONFIGS.get(
app.state.config.OPENAI_API_BASE_URLS[idx], {}