fix(ollama_chat.py): don't pop from dictionary while iterating through it

This commit is contained in:
Krrish Dholakia 2024-03-22 08:18:22 -07:00
parent 93a1a865f0
commit dfcc0c9ff0

View file

@ -173,10 +173,11 @@ class OllamaChatConfig:
litellm.add_function_to_prompt = ( litellm.add_function_to_prompt = (
True # so that main.py adds the function call to the 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" "functions"
) )
non_default_params.pop("tool_choice", None) # causes ollama requests to hang 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 return optional_params