mirror of https://github.com/Mai-with-u/MaiBot.git
Update src/llm_models/utils_model.py
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>pull/1057/head
parent
c7a804e286
commit
7961a1f04c
|
|
@ -130,8 +130,13 @@ class LLMRequest:
|
||||||
self.pri_out = model.get("pri_out", 0)
|
self.pri_out = model.get("pri_out", 0)
|
||||||
self.max_tokens = model.get("max_tokens", global_config.model.model_max_output_length)
|
self.max_tokens = model.get("max_tokens", global_config.model.model_max_output_length)
|
||||||
# print(f"max_tokens: {self.max_tokens}")
|
# print(f"max_tokens: {self.max_tokens}")
|
||||||
self.custom_params = model.get("custom_params", "{}")
|
custom_params_str = model.get("custom_params", "{}")
|
||||||
self.custom_params = json.loads(self.custom_params)
|
try:
|
||||||
|
self.custom_params = json.loads(custom_params_str)
|
||||||
|
except json.JSONDecodeError as e:
|
||||||
|
logger.error(f"Invalid JSON in custom_params for model '{self.model_name}': {custom_params_str}")
|
||||||
|
self.custom_params = {}
|
||||||
|
|
||||||
|
|
||||||
# 获取数据库实例
|
# 获取数据库实例
|
||||||
self._init_database()
|
self._init_database()
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue