mirror of
https://github.com/open-webui/open-webui
synced 2025-04-20 22:35:03 +00:00
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:
parent
a560f789e4
commit
e6919c3242
@ -190,10 +190,6 @@ def convert_payload_openai_to_ollama(openai_payload: dict) -> dict:
|
|||||||
elif "max_tokens" in openai_payload:
|
elif "max_tokens" in openai_payload:
|
||||||
ollama_options["num_predict"] = openai_payload["max_tokens"]
|
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
|
# Add options to payload if any have been set
|
||||||
if ollama_options:
|
if ollama_options:
|
||||||
ollama_payload["options"] = ollama_options
|
ollama_payload["options"] = ollama_options
|
||||||
|
Loading…
Reference in New Issue
Block a user