perf: init model (#4610)

* fix: model config undefined value

* perf: init model
This commit is contained in:
Archer
2025-04-21 14:44:34 +08:00
committed by GitHub
parent f789af51f5
commit 9cd6d2e81f
11 changed files with 80 additions and 60 deletions

View File

@@ -26,9 +26,9 @@ const MyNumberInput = (props: Props) => {
<NumberInput
{...restProps}
onBlur={(e) => {
const numE = Number(e.target.value);
const numE = e.target.value === '' ? '' : Number(e.target.value);
if (onBlur) {
if (isNaN(numE)) {
if (numE === '') {
// @ts-ignore
onBlur('');
} else {
@@ -46,9 +46,9 @@ const MyNumberInput = (props: Props) => {
}
}}
onChange={(e) => {
const numE = Number(e);
const numE = e === '' ? '' : Number(e);
if (onChange) {
if (isNaN(numE)) {
if (numE === '') {
// @ts-ignore
onChange('');
} else {
@@ -62,6 +62,7 @@ const MyNumberInput = (props: Props) => {
value: numE
}
};
register(name).onChange(event);
}
}}

View File

@@ -30,7 +30,7 @@
"log_status": "Status",
"mapping": "Model Mapping",
"mapping_tip": "A valid Json is required. \nThe model can be mapped when sending a request to the actual address. \nFor example:\n{\n \n \"gpt-4o\": \"gpt-4o-test\"\n\n}\n\nWhen FastGPT requests the gpt-4o model, the gpt-4o-test model is sent to the actual address, instead of gpt-4o.",
"maxToken_tip": "The model max_tokens parameter, if left blank, means that the model does not support it.",
"maxToken_tip": "Model max_tokens parameter",
"max_temperature_tip": "If the model temperature parameter is not filled in, it means that the model does not support the temperature parameter.",
"model": "Model",
"model_name": "Model name",

View File

@@ -30,7 +30,7 @@
"log_status": "状态",
"mapping": "模型映射",
"mapping_tip": "需填写一个有效 Json。可在向实际地址发送请求时对模型进行映射。例如\n{\n \"gpt-4o\": \"gpt-4o-test\"\n}\n当 FastGPT 请求 gpt-4o 模型时,会向实际地址发送 gpt-4o-test 的模型,而不是 gpt-4o。",
"maxToken_tip": "模型 max_tokens 参数,如果留空,则代表模型不支持该参数。",
"maxToken_tip": "模型 max_tokens 参数",
"max_temperature_tip": "模型 temperature 参数,不填则代表模型不支持 temperature 参数。",
"model": "模型",
"model_name": "模型名",

View File

@@ -28,7 +28,7 @@
"log_status": "狀態",
"mapping": "模型對映",
"mapping_tip": "需填寫一個有效 Json。\n可在向實際地址傳送請求時對模型進行對映。\n例如\n{\n \n \"gpt-4o\": \"gpt-4o-test\"\n\n}\n\n當 FastGPT 請求 gpt-4o 模型時,會向實際地址傳送 gpt-4o-test 的模型,而不是 gpt-4o。",
"maxToken_tip": "模型 max_tokens 參數,如果留空,則代表模型不支援該參數。",
"maxToken_tip": "模型 max_tokens 參數",
"max_temperature_tip": "模型 temperature 參數,不填則代表模型不支援 temperature 參數。",
"model": "模型",
"model_name": "模型名",