mirror of
https://github.com/open-webui/open-webui
synced 2025-02-23 05:38:41 +00:00
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.
This commit is contained in:
parent
3f3a5bb0ab
commit
a560f789e4
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user