mirror of
https://github.com/open-webui/open-webui.git
synced 2025-12-18 15:25:20 +00:00
fix: undefined model_id issue
This commit is contained in:
parent
25cc8049c8
commit
cd778582d5
1 changed files with 1 additions and 1 deletions
|
|
@ -1375,13 +1375,13 @@ async def chat_completion(
|
||||||
if not request.app.state.MODELS:
|
if not request.app.state.MODELS:
|
||||||
await get_all_models(request, user=user)
|
await get_all_models(request, user=user)
|
||||||
|
|
||||||
|
model_id = form_data.get("model", None)
|
||||||
model_item = form_data.pop("model_item", {})
|
model_item = form_data.pop("model_item", {})
|
||||||
tasks = form_data.pop("background_tasks", None)
|
tasks = form_data.pop("background_tasks", None)
|
||||||
|
|
||||||
metadata = {}
|
metadata = {}
|
||||||
try:
|
try:
|
||||||
if not model_item.get("direct", False):
|
if not model_item.get("direct", False):
|
||||||
model_id = form_data.get("model", None)
|
|
||||||
if model_id not in request.app.state.MODELS:
|
if model_id not in request.app.state.MODELS:
|
||||||
raise Exception("Model not found")
|
raise Exception("Model not found")
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue