fix: Embedding error in file parsing #1835 (#1839)

### What problem does this PR solve?

fix: Embedding error in file parsing #1835

### Type of change

- [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
balibabu 2024-08-07 10:22:40 +08:00 committed by GitHub
parent 4ae9de76d4
commit 3c19e3125b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,8 +1,9 @@
import { LlmModelType } from '@/constants/knowledge';
import {
useFetchKnowledgeBaseConfiguration,
useUpdateKnowledge,
} from '@/hooks/knowledge-hooks';
import { useSelectLlmOptions } from '@/hooks/llm-hooks';
import { useSelectLlmOptionsByModelType } from '@/hooks/llm-hooks';
import { useNavigateToDataset } from '@/hooks/route-hook';
import { useSelectParserList } from '@/hooks/user-setting-hooks';
import {
@ -38,7 +39,7 @@ export const useSubmitKnowledgeConfiguration = (form: FormInstance) => {
export const useFetchKnowledgeConfigurationOnMount = (form: FormInstance) => {
const parserList = useSelectParserList();
const embeddingModelOptions = useSelectLlmOptions();
const allOptions = useSelectLlmOptionsByModelType();
const { data: knowledgeDetails } = useFetchKnowledgeBaseConfiguration();
@ -62,7 +63,7 @@ export const useFetchKnowledgeConfigurationOnMount = (form: FormInstance) => {
return {
parserList,
embeddingModelOptions,
embeddingModelOptions: allOptions[LlmModelType.Embedding],
disabled: knowledgeDetails.chunk_num > 0,
};
};