From dfcc0c9ff0b4939ab71738a895fe36df290a2e6e Mon Sep 17 00:00:00 2001 From: Krrish Dholakia Date: Fri, 22 Mar 2024 08:18:22 -0700 Subject: [PATCH] fix(ollama_chat.py): don't pop from dictionary while iterating through it --- litellm/llms/ollama_chat.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/litellm/llms/ollama_chat.py b/litellm/llms/ollama_chat.py index cebdbb74ab..11e08fb725 100644 --- a/litellm/llms/ollama_chat.py +++ b/litellm/llms/ollama_chat.py @@ -173,10 +173,11 @@ class OllamaChatConfig: litellm.add_function_to_prompt = ( True # so that main.py adds the function call to the prompt ) - optional_params["functions_unsupported_model"] = non_default_params.pop( + optional_params["functions_unsupported_model"] = non_default_params.get( "functions" ) non_default_params.pop("tool_choice", None) # causes ollama requests to hang + non_default_params.pop("functions", None) # causes ollama requests to hang return optional_params