From cac27b27304ddbb70d2845c3d11a3642fe522429 Mon Sep 17 00:00:00 2001 From: smonux Date: Mon, 14 Oct 2024 21:27:06 +0200 Subject: [PATCH] fix for llama 3.1 --- backend/open_webui/main.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/backend/open_webui/main.py b/backend/open_webui/main.py index 50efaf72d..81ed8d05f 100644 --- a/backend/open_webui/main.py +++ b/backend/open_webui/main.py @@ -443,12 +443,12 @@ def fill_with_delta(fcall_dict:dict, delta:dict) -> None: return j = delta['choices'][0]['delta']['tool_calls'][0] if 'id' in j: - fcall_dict["id"] += j["id"] + fcall_dict["id"] += j["id"] or '' if 'function' in j: if 'name' in j['function']: - fcall_dict['function']['name'] += j['function']['name'] + fcall_dict['function']['name'] += j['function']['name'] or '' if 'arguments' in j['function']: - fcall_dict['function']['arguments'] += j['function']['arguments'] + fcall_dict['function']['arguments'] += j['function']['arguments'] or '' async def handle_streaming_response(request: Request, response: Response, tools: dict,