mirror of
https://github.com/open-webui/open-webui.git
synced 2025-12-15 13:55:19 +00:00
Merge pull request #12549 from ulagbulag/fix/500-when-unknown-models
fix: internal server error when calling completions API with non-existent model names
This commit is contained in:
commit
d1a77a9110
1 changed files with 3 additions and 0 deletions
|
|
@ -1053,6 +1053,9 @@ async def chat_completion(
|
||||||
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)
|
||||||
|
|
||||||
|
# placeholder
|
||||||
|
metadata = {}
|
||||||
|
|
||||||
try:
|
try:
|
||||||
if not model_item.get("direct", False):
|
if not model_item.get("direct", False):
|
||||||
model_id = form_data.get("model", None)
|
model_id = form_data.get("model", None)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue