Browse Source

Remove mapping of presence_penalty to new_topix_penalty

1) Ollama natively supports presence_penalty.
2) new_topic_penalty is not a valid option in Ollama. (See https://github.com/ollama/ollama/blob/main/docs/api.md#request-8)
3) Presence_penalty was added to Open Webui in PR #10016 and is not merged to main yet at this time.
ferret99gt 2 months ago
parent
commit
a560f789e4
1 changed files with 0 additions and 4 deletions
  1. 0 4
      backend/open_webui/utils/payload.py

+ 0 - 4
backend/open_webui/utils/payload.py

@@ -194,10 +194,6 @@ def convert_payload_openai_to_ollama(openai_payload: dict) -> dict:
     if "frequency_penalty" in openai_payload:
         ollama_options["repeat_penalty"] = openai_payload["frequency_penalty"]
 
-    if "presence_penalty" in openai_payload and "penalty" not in ollama_options:
-        # We are assuming presence penalty uses a similar concept in Ollama, which needs custom handling if exists.
-        ollama_options["new_topic_penalty"] = openai_payload["presence_penalty"]
-
     # Add options to payload if any have been set
     if ollama_options:
         ollama_payload["options"] = ollama_options