mirror of
https://github.com/open-webui/open-webui.git
synced 2025-03-27 02:02:31 +01:00
Remove empty ollama_options
1) The empty dictionary from line 176 is never used. 2) Lines 193-194 are not necessary as they were already done at line 177
This commit is contained in:
parent
57b01cf8fb
commit
8125b0499b
@ -173,8 +173,6 @@ def convert_payload_openai_to_ollama(openai_payload: dict) -> dict:
|
||||
ollama_payload["format"] = openai_payload["format"]
|
||||
|
||||
# If there are advanced parameters in the payload, format them in Ollama's options field
|
||||
ollama_options = {}
|
||||
|
||||
if openai_payload.get("options"):
|
||||
ollama_payload["options"] = openai_payload["options"]
|
||||
ollama_options = openai_payload["options"]
|
||||
@ -189,10 +187,6 @@ def convert_payload_openai_to_ollama(openai_payload: dict) -> dict:
|
||||
ollama_payload["system"] = ollama_options["system"]
|
||||
del ollama_options["system"] # To prevent Ollama warning of invalid option provided
|
||||
|
||||
# Add options to payload if any have been set
|
||||
if ollama_options:
|
||||
ollama_payload["options"] = ollama_options
|
||||
|
||||
if "metadata" in openai_payload:
|
||||
ollama_payload["metadata"] = openai_payload["metadata"]
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user