mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-08 20:42:30 +08:00
### What problem does this PR solve? Fix: Merge different types of models from the same manufacturer #10146 ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
@ -136,6 +136,7 @@ export const useSelectLlmOptionsByModelType = () => {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Merge different types of models from the same manufacturer under one manufacturer
|
||||||
export const useComposeLlmOptionsByModelTypes = (
|
export const useComposeLlmOptionsByModelTypes = (
|
||||||
modelTypes: LlmModelType[],
|
modelTypes: LlmModelType[],
|
||||||
) => {
|
) => {
|
||||||
|
|||||||
@ -1,7 +1,10 @@
|
|||||||
import { IModalManagerChildrenProps } from '@/components/modal-manager';
|
import { IModalManagerChildrenProps } from '@/components/modal-manager';
|
||||||
import { LlmModelType } from '@/constants/knowledge';
|
import { LlmModelType } from '@/constants/knowledge';
|
||||||
import { useTranslate } from '@/hooks/common-hooks';
|
import { useTranslate } from '@/hooks/common-hooks';
|
||||||
import { ISystemModelSettingSavingParams } from '@/hooks/llm-hooks';
|
import {
|
||||||
|
ISystemModelSettingSavingParams,
|
||||||
|
useComposeLlmOptionsByModelTypes,
|
||||||
|
} from '@/hooks/llm-hooks';
|
||||||
import { Form, Modal, Select } from 'antd';
|
import { Form, Modal, Select } from 'antd';
|
||||||
import { useEffect } from 'react';
|
import { useEffect } from 'react';
|
||||||
import { useFetchSystemModelSettingOnMount } from '../hooks';
|
import { useFetchSystemModelSettingOnMount } from '../hooks';
|
||||||
@ -43,6 +46,11 @@ const SystemModelSettingModal = ({
|
|||||||
|
|
||||||
const onFormLayoutChange = () => {};
|
const onFormLayoutChange = () => {};
|
||||||
|
|
||||||
|
const modelOptions = useComposeLlmOptionsByModelTypes([
|
||||||
|
LlmModelType.Chat,
|
||||||
|
LlmModelType.Image2text,
|
||||||
|
]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Modal
|
<Modal
|
||||||
title={t('systemModelSettings')}
|
title={t('systemModelSettings')}
|
||||||
@ -58,14 +66,7 @@ const SystemModelSettingModal = ({
|
|||||||
name="llm_id"
|
name="llm_id"
|
||||||
tooltip={t('chatModelTip')}
|
tooltip={t('chatModelTip')}
|
||||||
>
|
>
|
||||||
<Select
|
<Select options={modelOptions} allowClear showSearch />
|
||||||
options={[
|
|
||||||
...allOptions[LlmModelType.Chat],
|
|
||||||
...allOptions[LlmModelType.Image2text],
|
|
||||||
]}
|
|
||||||
allowClear
|
|
||||||
showSearch
|
|
||||||
/>
|
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
label={t('embeddingModel')}
|
label={t('embeddingModel')}
|
||||||
|
|||||||
Reference in New Issue
Block a user