balibabu
commited on
Commit
·
aa07fb5
1
Parent(s):
64dd66b
fix: Embedding error in file parsing #1835 (#1839)
Browse files### 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)
web/src/pages/add-knowledge/components/knowledge-setting/hooks.ts
CHANGED
@@ -1,8 +1,9 @@
|
|
|
|
1 |
import {
|
2 |
useFetchKnowledgeBaseConfiguration,
|
3 |
useUpdateKnowledge,
|
4 |
} from '@/hooks/knowledge-hooks';
|
5 |
-
import {
|
6 |
import { useNavigateToDataset } from '@/hooks/route-hook';
|
7 |
import { useSelectParserList } from '@/hooks/user-setting-hooks';
|
8 |
import {
|
@@ -38,7 +39,7 @@ export const useSubmitKnowledgeConfiguration = (form: FormInstance) => {
|
|
38 |
|
39 |
export const useFetchKnowledgeConfigurationOnMount = (form: FormInstance) => {
|
40 |
const parserList = useSelectParserList();
|
41 |
-
const
|
42 |
|
43 |
const { data: knowledgeDetails } = useFetchKnowledgeBaseConfiguration();
|
44 |
|
@@ -62,7 +63,7 @@ export const useFetchKnowledgeConfigurationOnMount = (form: FormInstance) => {
|
|
62 |
|
63 |
return {
|
64 |
parserList,
|
65 |
-
embeddingModelOptions,
|
66 |
disabled: knowledgeDetails.chunk_num > 0,
|
67 |
};
|
68 |
};
|
|
|
1 |
+
import { LlmModelType } from '@/constants/knowledge';
|
2 |
import {
|
3 |
useFetchKnowledgeBaseConfiguration,
|
4 |
useUpdateKnowledge,
|
5 |
} from '@/hooks/knowledge-hooks';
|
6 |
+
import { useSelectLlmOptionsByModelType } from '@/hooks/llm-hooks';
|
7 |
import { useNavigateToDataset } from '@/hooks/route-hook';
|
8 |
import { useSelectParserList } from '@/hooks/user-setting-hooks';
|
9 |
import {
|
|
|
39 |
|
40 |
export const useFetchKnowledgeConfigurationOnMount = (form: FormInstance) => {
|
41 |
const parserList = useSelectParserList();
|
42 |
+
const allOptions = useSelectLlmOptionsByModelType();
|
43 |
|
44 |
const { data: knowledgeDetails } = useFetchKnowledgeBaseConfiguration();
|
45 |
|
|
|
63 |
|
64 |
return {
|
65 |
parserList,
|
66 |
+
embeddingModelOptions: allOptions[LlmModelType.Embedding],
|
67 |
disabled: knowledgeDetails.chunk_num > 0,
|
68 |
};
|
69 |
};
|