mirror of
https://github.com/open-webui/open-webui
synced 2025-02-23 13:51:07 +00:00
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.
This commit is contained in:
parent
aea8977d05
commit
adde37394b
@ -179,11 +179,6 @@ def convert_payload_openai_to_ollama(openai_payload: dict) -> dict:
|
|||||||
ollama_payload["options"] = openai_payload["options"]
|
ollama_payload["options"] = openai_payload["options"]
|
||||||
ollama_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`
|
# Mapping OpenAI's `max_tokens` -> Ollama's `num_predict`
|
||||||
if "max_tokens" in openai_payload:
|
if "max_tokens" in openai_payload:
|
||||||
ollama_options["num_predict"] = openai_payload["max_tokens"]
|
ollama_options["num_predict"] = openai_payload["max_tokens"]
|
||||||
|
Loading…
Reference in New Issue
Block a user