mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-08 20:42:30 +08:00
Fix: unexpected LLM parameters (#9661)
### What problem does this PR solve? Remove unexpected LLM parameters. ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
@ -112,6 +112,32 @@ class Base(ABC):
|
|||||||
def _clean_conf(self, gen_conf):
|
def _clean_conf(self, gen_conf):
|
||||||
if "max_tokens" in gen_conf:
|
if "max_tokens" in gen_conf:
|
||||||
del gen_conf["max_tokens"]
|
del gen_conf["max_tokens"]
|
||||||
|
|
||||||
|
allowed_conf = {
|
||||||
|
"temperature",
|
||||||
|
"max_completion_tokens",
|
||||||
|
"top_p",
|
||||||
|
"stream",
|
||||||
|
"stream_options",
|
||||||
|
"stop",
|
||||||
|
"n",
|
||||||
|
"presence_penalty",
|
||||||
|
"frequency_penalty",
|
||||||
|
"functions",
|
||||||
|
"function_call",
|
||||||
|
"logit_bias",
|
||||||
|
"user",
|
||||||
|
"response_format",
|
||||||
|
"seed",
|
||||||
|
"tools",
|
||||||
|
"tool_choice",
|
||||||
|
"logprobs",
|
||||||
|
"top_logprobs",
|
||||||
|
"extra_headers",
|
||||||
|
}
|
||||||
|
|
||||||
|
gen_conf = {k: v for k, v in gen_conf.items() if k in allowed_conf}
|
||||||
|
|
||||||
return gen_conf
|
return gen_conf
|
||||||
|
|
||||||
def _chat(self, history, gen_conf, **kwargs):
|
def _chat(self, history, gen_conf, **kwargs):
|
||||||
|
|||||||
Reference in New Issue
Block a user