mirror of
https://github.com/open-webui/open-webui
synced 2024-11-16 13:40:55 +00:00
fix: allow temperature and seed to be 0
This commit is contained in:
parent
e426067e46
commit
c3693c91b3
@ -805,7 +805,7 @@ async def generate_chat_completion(
|
|||||||
)
|
)
|
||||||
|
|
||||||
if (
|
if (
|
||||||
model_info.params.get("temperature", None)
|
model_info.params.get("temperature", None) is not None
|
||||||
and payload["options"].get("temperature") is None
|
and payload["options"].get("temperature") is None
|
||||||
):
|
):
|
||||||
payload["options"]["temperature"] = model_info.params.get(
|
payload["options"]["temperature"] = model_info.params.get(
|
||||||
@ -813,7 +813,7 @@ async def generate_chat_completion(
|
|||||||
)
|
)
|
||||||
|
|
||||||
if (
|
if (
|
||||||
model_info.params.get("seed", None)
|
model_info.params.get("seed", None) is not None
|
||||||
and payload["options"].get("seed") is None
|
and payload["options"].get("seed") is None
|
||||||
):
|
):
|
||||||
payload["options"]["seed"] = model_info.params.get("seed", None)
|
payload["options"]["seed"] = model_info.params.get("seed", None)
|
||||||
|
@ -372,7 +372,7 @@ async def generate_chat_completion(
|
|||||||
|
|
||||||
if model_info.params:
|
if model_info.params:
|
||||||
if (
|
if (
|
||||||
model_info.params.get("temperature", None)
|
model_info.params.get("temperature", None) is not None
|
||||||
and payload.get("temperature") is None
|
and payload.get("temperature") is None
|
||||||
):
|
):
|
||||||
payload["temperature"] = float(model_info.params.get("temperature"))
|
payload["temperature"] = float(model_info.params.get("temperature"))
|
||||||
@ -394,7 +394,10 @@ async def generate_chat_completion(
|
|||||||
model_info.params.get("frequency_penalty", None)
|
model_info.params.get("frequency_penalty", None)
|
||||||
)
|
)
|
||||||
|
|
||||||
if model_info.params.get("seed", None) and payload.get("seed") is None:
|
if (
|
||||||
|
model_info.params.get("seed", None) is not None
|
||||||
|
and payload.get("seed") is None
|
||||||
|
):
|
||||||
payload["seed"] = model_info.params.get("seed", None)
|
payload["seed"] = model_info.params.get("seed", None)
|
||||||
|
|
||||||
if model_info.params.get("stop", None) and payload.get("stop") is None:
|
if model_info.params.get("stop", None) and payload.get("stop") is None:
|
||||||
|
Loading…
Reference in New Issue
Block a user