Skip to content

Commit

Permalink
fix: model check circle tip (#3786)
Browse files Browse the repository at this point in the history
* model config

* feat: normalization embedding

* remove log

* version doc

* version doc

* fix: model check circle tip

* uml
  • Loading branch information
c121914yu authored Feb 14, 2025
1 parent 1226fe4 commit d2b60ec
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 21 deletions.
3 changes: 1 addition & 2 deletions docSite/content/zh-cn/docs/development/modelConfig/intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,7 @@ weight: 744
{{% alert icon="🤖 " context="success" %}}
注意:
1. 目前语音识别模型和重排模型仅会生效一个,所以配置时候,只需要配置一个即可。
2. 系统必须至少有一个语言模型和一个索引模型才能正常使用。
3. 使用知识库功能,至少要有一个语言模型,用于知识库文件处理(可以在模型配置时候打开该开关),否则知识库会报错。
2. 系统至少需要一个语言模型和一个索引模型才能正常使用。
{{% /alert %}}

#### 核心配置
Expand Down
6 changes: 4 additions & 2 deletions packages/web/i18n/en/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@
"Move": "Move",
"Name": "Name",
"None": "None",
"Operation": "Operation",
"Rename": "Rename",
"Required_input": "Required",
"Resume": "Resume",
"Running": "Running",
"Select_all": "Select all",
Expand Down Expand Up @@ -165,7 +167,6 @@
"common.Not open": "Not Open",
"common.OK": "OK",
"common.Open": "Open",
"Operation": "Operation",
"common.Other": "Other",
"common.Output": "Output",
"common.Params": "Parameters",
Expand All @@ -179,7 +180,6 @@
"common.Remove": "Remove",
"common.Rename": "Rename",
"common.Request Error": "Request Error",
"Required_input": "Required",
"common.Reset": "Reset",
"common.Restart": "Restart",
"common.Role": "Permission",
Expand Down Expand Up @@ -878,6 +878,7 @@
"dataset.test.noResult": "No Search Results",
"deep_rag_search": "In-depth search",
"delete_api": "Are you sure you want to delete this API key? \nAfter deletion, the key will become invalid immediately and the corresponding conversation log will not be deleted. Please confirm!",
"embedding_model_not_config": "No index model is detected",
"error.Create failed": "Create failed",
"error.code_error": "Verification code error",
"error.fileNotFound": "File not found~",
Expand Down Expand Up @@ -914,6 +915,7 @@
"item_name": "Field Name",
"just_now": "just",
"key_repetition": "Key Repetition",
"llm_model_not_config": "No language model was detected",
"max_quote_tokens": "Quote cap",
"max_quote_tokens_tips": "The maximum number of tokens in a single search, about 1 character in Chinese = 1.7 tokens, and about 1 character in English = 1 token",
"min_similarity": "lowest correlation",
Expand Down
1 change: 0 additions & 1 deletion packages/web/i18n/en/login.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
"forget_password": "Find Password",
"login_failed": "Login failed",
"login_success": "Login successful",
"model_not_config": "It is detected that the system has not configured the model, please configure the model before using it",
"no_remind": "Don't remind again",
"password_condition": "Password maximum 60 characters",
"password_tip": "Password must be at least 6 characters long and contain at least two combinations: numbers, letters, or special characters",
Expand Down
6 changes: 4 additions & 2 deletions packages/web/i18n/zh-CN/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@
"Move": "移动",
"Name": "名称",
"None": "",
"Operation": "操作",
"Rename": "重命名",
"Required_input": "必填",
"Resume": "恢复",
"Running": "运行中",
"Select_all": "全选",
Expand Down Expand Up @@ -169,7 +171,6 @@
"common.Not open": "未开启",
"common.OK": "好的",
"common.Open": "打开",
"Operation": "操作",
"common.Other": "其他",
"common.Output": "输出",
"common.Params": "参数",
Expand All @@ -183,7 +184,6 @@
"common.Remove": "移除",
"common.Rename": "重命名",
"common.Request Error": "请求异常",
"Required_input": "必填",
"common.Reset": "恢复默认",
"common.Restart": "重新开始",
"common.Role": "权限",
Expand Down Expand Up @@ -881,6 +881,7 @@
"dataset.test.noResult": "搜索结果为空",
"deep_rag_search": "深度搜索",
"delete_api": "确认删除该API密钥?删除后该密钥立即失效,对应的对话日志不会删除,请确认!",
"embedding_model_not_config": "检测到没有可用的索引模型",
"error.Create failed": "创建失败",
"error.code_error": "验证码错误",
"error.fileNotFound": "文件找不到了~",
Expand Down Expand Up @@ -917,6 +918,7 @@
"item_name": "字段名",
"just_now": "刚刚",
"key_repetition": "key 重复",
"llm_model_not_config": "检测到没有可用的语言模型",
"max_quote_tokens": "引用上限",
"max_quote_tokens_tips": "单次搜索最大的 token 数量,中文约 1 字=1.7 tokens,英文约 1 字=1 token",
"min_similarity": "最低相关度",
Expand Down
1 change: 0 additions & 1 deletion packages/web/i18n/zh-CN/login.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
"forget_password": "忘记密码?",
"login_failed": "登录异常",
"login_success": "登录成功",
"model_not_config": "检测到系统未配置模型,请先配置模型后再使用",
"no_remind": "不再提醒",
"password_condition": "密码最多 60 位",
"password_tip": "密码至少 6 位,且至少包含两种组合:数字、字母或特殊字符",
Expand Down
6 changes: 4 additions & 2 deletions packages/web/i18n/zh-Hant/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@
"Move": "移動",
"Name": "名稱",
"None": "",
"Operation": "操作",
"Rename": "重新命名",
"Required_input": "必填",
"Resume": "繼續",
"Running": "執行中",
"Select_all": "全選",
Expand Down Expand Up @@ -164,7 +166,6 @@
"common.Not open": "未開啟",
"common.OK": "確定",
"common.Open": "開啟",
"Operation": "操作",
"common.Other": "其他",
"common.Output": "輸出",
"common.Params": "參數",
Expand All @@ -178,7 +179,6 @@
"common.Remove": "移除",
"common.Rename": "重新命名",
"common.Request Error": "請求錯誤",
"Required_input": "必填",
"common.Reset": "恢復預設",
"common.Restart": "重新開始",
"common.Role": "權限",
Expand Down Expand Up @@ -878,6 +878,7 @@
"dataset.test.noResult": "搜尋結果為空",
"deep_rag_search": "深度搜索",
"delete_api": "確認刪除此 API 金鑰?\n刪除後該金鑰將立即失效,對應的對話記錄不會被刪除,請確認!",
"embedding_model_not_config": "檢測到沒有可用的索引模型",
"error.Create failed": "建立失敗",
"error.code_error": "驗證碼錯誤",
"error.fileNotFound": "找不到檔案",
Expand Down Expand Up @@ -914,6 +915,7 @@
"item_name": "欄位名稱",
"just_now": "剛剛",
"key_repetition": "鍵值重複",
"llm_model_not_config": "檢測到沒有可用的語言模型",
"max_quote_tokens": "引用上限",
"max_quote_tokens_tips": "單次搜尋最大的 token 數量,中文約 1 字=1.7 tokens,英文約 1 字=1 token",
"min_similarity": "最低相關度",
Expand Down
1 change: 0 additions & 1 deletion packages/web/i18n/zh-Hant/login.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
"forget_password": "忘記密碼?",
"login_failed": "登入失敗",
"login_success": "登入成功",
"model_not_config": "檢測到系統未配置模型,請先配置模型後再使用",
"no_remind": "不再提醒",
"password_condition": "密碼最多 60 個字元",
"password_tip": "密碼至少 6 位,且至少包含兩種組合:數字、字母或特殊字符",
Expand Down
25 changes: 15 additions & 10 deletions projects/app/src/components/Layout/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,17 +89,22 @@ const Layout = ({ children }: { children: JSX.Element }) => {

// Check model invalid
useEffect(() => {
if (
userInfo?.username === 'root' &&
(llmModelList.length === 0 || embeddingModelList.length === 0)
) {
toast({
status: 'warning',
title: t('login:model_not_config')
});
router.push('/account/model');
if (userInfo?.username === 'root') {
if (llmModelList.length === 0) {
toast({
status: 'warning',
title: t('common:llm_model_not_config')
});
router.push('/account/model');
} else if (embeddingModelList.length === 0) {
toast({
status: 'warning',
title: t('common:embedding_model_not_config')
});
router.push('/account/model');
}
}
}, [embeddingModelList.length, llmModelList.length, router, t, toast, userInfo?.username]);
}, [embeddingModelList.length, llmModelList.length, userInfo?.username]);

return (
<>
Expand Down

0 comments on commit d2b60ec

Please sign in to comment.