Remove mapping of frequency_penalty to repeat_penalty

1) Ollama natively supports frequency_penalty.
2) repeat_penaltywas added to Open Webui in PR #10016 and is not merged to main yet at this time. Once both changes go live, Ollama users can freely choose between frequency/presence penalty, or repeat penalty, as they choose.
This commit is contained in:
ferret99gt 2025-02-19 08:33:29 -05:00
parent a560f789e4
commit e6919c3242

View File

@ -190,10 +190,6 @@ def convert_payload_openai_to_ollama(openai_payload: dict) -> dict:
elif "max_tokens" in openai_payload:
ollama_options["num_predict"] = openai_payload["max_tokens"]
# Handle frequency / presence_penalty, which needs renaming and checking
if "frequency_penalty" in openai_payload:
ollama_options["repeat_penalty"] = openai_payload["frequency_penalty"]
# Add options to payload if any have been set
if ollama_options:
ollama_payload["options"] = ollama_options