浏览代码

fix: internal server error when calling completions API with non-existent model names

Signed-off-by: Ho Kim <ho.kim@ulagbulag.io>
Ho Kim 1 月之前
父节点
当前提交
1efae95a36
共有 1 个文件被更改,包括 3 次插入0 次删除
  1. 3 0
      backend/open_webui/main.py

+ 3 - 0
backend/open_webui/main.py

@@ -1053,6 +1053,9 @@ async def chat_completion(
     model_item = form_data.pop("model_item", {})
     tasks = form_data.pop("background_tasks", None)
 
+    # placeholder
+    metadata = {}
+
     try:
         if not model_item.get("direct", False):
             model_id = form_data.get("model", None)