mirror of
https://git.mirrors.martin98.com/https://github.com/infiniflow/ragflow.git
synced 2025-08-12 23:09:04 +08:00
### What problem does this PR solve? Feat: When selecting a reordering model, give a prompt that it takes too long. #5834 ### Type of change - [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
parent
15736c57c3
commit
1163e9e409
@ -1,7 +1,8 @@
|
||||
import { LlmModelType } from '@/constants/knowledge';
|
||||
import { useTranslate } from '@/hooks/common-hooks';
|
||||
import { useSelectLlmOptionsByModelType } from '@/hooks/llm-hooks';
|
||||
import { Select as AntSelect, Form, Slider } from 'antd';
|
||||
import { Select as AntSelect, Form, message, Slider } from 'antd';
|
||||
import { useCallback } from 'react';
|
||||
import { useFormContext } from 'react-hook-form';
|
||||
import { SingleFormSlider } from './ui/dual-range-slider';
|
||||
import {
|
||||
@ -29,19 +30,36 @@ type FieldType = {
|
||||
export const RerankItem = () => {
|
||||
const { t } = useTranslate('knowledgeDetails');
|
||||
const allOptions = useSelectLlmOptionsByModelType();
|
||||
const [messageApi, contextHolder] = message.useMessage();
|
||||
|
||||
const handleChange = useCallback(
|
||||
(val: string) => {
|
||||
if (val) {
|
||||
messageApi.open({
|
||||
type: 'warning',
|
||||
content: t('reRankModelWaring'),
|
||||
});
|
||||
}
|
||||
},
|
||||
[messageApi, t],
|
||||
);
|
||||
|
||||
return (
|
||||
<Form.Item
|
||||
label={t('rerankModel')}
|
||||
name={'rerank_id'}
|
||||
tooltip={t('rerankTip')}
|
||||
>
|
||||
<AntSelect
|
||||
options={allOptions[LlmModelType.Rerank]}
|
||||
allowClear
|
||||
placeholder={t('rerankPlaceholder')}
|
||||
/>
|
||||
</Form.Item>
|
||||
<>
|
||||
{contextHolder}
|
||||
<Form.Item
|
||||
label={t('rerankModel')}
|
||||
name={'rerank_id'}
|
||||
tooltip={t('rerankTip')}
|
||||
>
|
||||
<AntSelect
|
||||
options={allOptions[LlmModelType.Rerank]}
|
||||
allowClear
|
||||
placeholder={t('rerankPlaceholder')}
|
||||
onChange={handleChange}
|
||||
/>
|
||||
</Form.Item>
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
|
@ -196,6 +196,7 @@ export default {
|
||||
deleteDocumentConfirmContent:
|
||||
'The document is associated with the knowledge graph. After deletion, the related node and relationship information will be deleted, but the graph will not be updated immediately. The update graph action is performed during the process of parsing the new document that carries the knowledge graph extraction task.',
|
||||
plainText: 'Naive',
|
||||
reRankModelWaring: 'Re-rank model is very time consuming.',
|
||||
},
|
||||
knowledgeConfiguration: {
|
||||
titleDescription:
|
||||
|
@ -106,7 +106,8 @@ export default {
|
||||
processBeginAt: '流程開始於',
|
||||
processDuration: '過程持續時間',
|
||||
progressMsg: '進度消息',
|
||||
testingDescription: '完成召回測試:確保你的設定可以從資料庫正確地召回文字區塊。請注意這裡的改動不會被自動保存。如果你調整了這裡的默認設置,比如關鍵詞相似度權重,請務必在聊天助手設置或者召回算子設置處同步更新相關設置。',
|
||||
testingDescription:
|
||||
'完成召回測試:確保你的設定可以從資料庫正確地召回文字區塊。請注意這裡的改動不會被自動保存。如果你調整了這裡的默認設置,比如關鍵詞相似度權重,請務必在聊天助手設置或者召回算子設置處同步更新相關設置。',
|
||||
similarityThreshold: '相似度閾值',
|
||||
similarityThresholdTip:
|
||||
'我們使用混合相似度得分來評估兩行文本之間的距離。它是加權關鍵詞相似度和向量餘弦相似度。如果查詢和塊之間的相似度小於此閾值,則該塊將被過濾掉。',
|
||||
@ -193,6 +194,7 @@ export default {
|
||||
deleteDocumentConfirmContent:
|
||||
'該文件與知識圖譜相關聯。刪除後,相關節點和關係資訊將被刪除,但圖不會立即更新。更新圖動作是在解析承載知識圖譜提取任務的新文件的過程中執行的。 ',
|
||||
plainText: 'Naive',
|
||||
reRankModelWaring: '重排序模型非常耗時。',
|
||||
},
|
||||
knowledgeConfiguration: {
|
||||
titleDescription: '在這裡更新您的知識庫詳細信息,尤其是切片方法。',
|
||||
|
@ -106,7 +106,8 @@ export default {
|
||||
processBeginAt: '开始于',
|
||||
processDuration: '持续时间',
|
||||
progressMsg: '进度',
|
||||
testingDescription: '请完成召回测试:确保你的配置可以从数据库召回正确的文本块。如果你调整了这里的默认设置,比如关键词相似度权重,请注意这里的改动不会被自动保存。请务必在聊天助手设置或者召回算子设置处同步更新相关设置。',
|
||||
testingDescription:
|
||||
'请完成召回测试:确保你的配置可以从数据库召回正确的文本块。如果你调整了这里的默认设置,比如关键词相似度权重,请注意这里的改动不会被自动保存。请务必在聊天助手设置或者召回算子设置处同步更新相关设置。',
|
||||
similarityThreshold: '相似度阈值',
|
||||
similarityThresholdTip:
|
||||
'我们使用混合相似度得分来评估两行文本之间的距离。 它是加权关键词相似度和向量余弦相似度。 如果查询和块之间的相似度小于此阈值,则该块将被过滤掉。',
|
||||
@ -193,6 +194,7 @@ export default {
|
||||
deleteDocumentConfirmContent:
|
||||
'该文档与知识图谱相关联。删除后,相关节点和关系信息将被删除,但图不会立即更新。更新图动作是在解析承载知识图谱提取任务的新文档的过程中执行的。',
|
||||
plainText: 'Naive',
|
||||
reRankModelWaring: '重排序模型非常耗时。',
|
||||
},
|
||||
knowledgeConfiguration: {
|
||||
titleDescription: '在这里更新您的知识库详细信息,尤其是切片方法。',
|
||||
|
@ -165,7 +165,7 @@ const PromptEngine = (
|
||||
label={t('multiTurn')}
|
||||
tooltip={t('multiTurnTip')}
|
||||
name={['prompt_config', 'refine_multiturn']}
|
||||
initialValue={true}
|
||||
initialValue={false}
|
||||
>
|
||||
<Switch></Switch>
|
||||
</Form.Item>
|
||||
|
Loading…
x
Reference in New Issue
Block a user