fix: model check circle tip (#3786)

* model config

* feat: normalization embedding

* remove log

* version doc

* version doc

* fix: model check circle tip

* uml
This commit is contained in:
Archer
2025-02-14 11:42:14 +08:00
committed by GitHub
parent 1226fe42a1
commit d2b60ec785
8 changed files with 28 additions and 21 deletions

View File

@@ -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 (
<>