mirror of
https://github.com/open-webui/open-webui
synced 2025-05-01 11:26:00 +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
@ -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 New Issue
Block a user