From ed205d82e8799a06ea9db4e6334228d99fad6678 Mon Sep 17 00:00:00 2001 From: Michael Poluektov Date: Tue, 6 Aug 2024 12:25:00 +0100 Subject: [PATCH] fix: pop --- backend/apps/ollama/main.py | 4 ++-- backend/apps/openai/main.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/backend/apps/ollama/main.py b/backend/apps/ollama/main.py index 19d914c4b..79a2773ba 100644 --- a/backend/apps/ollama/main.py +++ b/backend/apps/ollama/main.py @@ -729,7 +729,7 @@ async def generate_chat_completion( payload = { **form_data.model_dump(exclude_none=True, exclude=["metadata"]), } - payload.pop("metadata") + payload.pop("metadata", None) model_id = form_data.model model_info = Models.get_model_by_id(model_id) @@ -788,7 +788,7 @@ async def generate_openai_chat_completion( ): completion_form = OpenAIChatCompletionForm(**form_data) payload = {**completion_form.model_dump(exclude_none=True, exclude=["metadata"])} - payload.pop("metadata") + payload.pop("metadata", None) model_id = completion_form.model model_info = Models.get_model_by_id(model_id) diff --git a/backend/apps/openai/main.py b/backend/apps/openai/main.py index 1313d2091..44b3151e0 100644 --- a/backend/apps/openai/main.py +++ b/backend/apps/openai/main.py @@ -359,7 +359,7 @@ async def generate_chat_completion( ): idx = 0 payload = {**form_data} - payload.pop("metadata") + payload.pop("metadata", None) model_id = form_data.get("model") model_info = Models.get_model_by_id(model_id)