From adde37394b2788fb1f33a2b6f8efc674a6938ed0 Mon Sep 17 00:00:00 2001 From: ferret99gt Date: Wed, 19 Feb 2025 08:44:59 -0500 Subject: [PATCH] Remove parameters that map directly, as they are part of options 1) This may be legacy code? 2) All three of these parameters, temperature, top_p and seed, are found in openai_payload["options"], not openai_payload. They do not need remapped any longer. --- backend/open_webui/utils/payload.py | 5 ----- 1 file changed, 5 deletions(-) diff --git a/backend/open_webui/utils/payload.py b/backend/open_webui/utils/payload.py index 5dc0c4b52..4e15e7025 100644 --- a/backend/open_webui/utils/payload.py +++ b/backend/open_webui/utils/payload.py @@ -179,11 +179,6 @@ def convert_payload_openai_to_ollama(openai_payload: dict) -> dict: ollama_payload["options"] = openai_payload["options"] ollama_options = openai_payload["options"] - # Handle parameters which map directly - for param in ["temperature", "top_p", "seed"]: - if param in openai_payload: - ollama_options[param] = openai_payload[param] - # Mapping OpenAI's `max_tokens` -> Ollama's `num_predict` if "max_tokens" in openai_payload: ollama_options["num_predict"] = openai_payload["max_tokens"]