From f969dce345a26c33d3d6f14bf955c52886e23204 Mon Sep 17 00:00:00 2001 From: AkaraChen Date: Wed, 11 Dec 2024 16:50:32 +0800 Subject: [PATCH] feat: switch to high quan modal --- .../datasets/create/step-two/index.tsx | 21 +++++++++++-------- web/i18n/en-US/dataset-creation.ts | 3 +++ web/i18n/zh-Hans/dataset-creation.ts | 3 +++ 3 files changed, 18 insertions(+), 9 deletions(-) diff --git a/web/app/components/datasets/create/step-two/index.tsx b/web/app/components/datasets/create/step-two/index.tsx index 7c80bfb859..b87c1bf9e2 100644 --- a/web/app/components/datasets/create/step-two/index.tsx +++ b/web/app/components/datasets/create/step-two/index.tsx @@ -517,14 +517,11 @@ const StepTwo = ({ } const changeToEconomicalType = () => { - if (docForm === ChuckingMode.parentChild) + if (docForm !== ChuckingMode.text) return - if (!hasSetIndexType) { + if (!hasSetIndexType) setIndexType(IndexingType.ECONOMICAL) - if (docForm === ChuckingMode.qa) - handleChangeDocform(ChuckingMode.text) - } } useEffect(() => { @@ -842,19 +839,25 @@ const StepTwo = ({ > setIsQAConfirmDialogOpen(false)} className='w-[432px]'>
-

Q&A Format Requires High-quality Indexing Method

-

Currently, only high-quality index method supports Q&A format chunking. Would you like to switch to high-quality mode?

+

+ {t('datasetCreation.stepTwo.qaSwitchHighQualityTipTitle')} +

+

+ {t('datasetCreation.stepTwo.qaSwitchHighQualityTipContent')} +

+ }}> + {t('datasetCreation.stepTwo.cancel')} +
diff --git a/web/i18n/en-US/dataset-creation.ts b/web/i18n/en-US/dataset-creation.ts index 014f9a1a93..cbd02d10eb 100644 --- a/web/i18n/en-US/dataset-creation.ts +++ b/web/i18n/en-US/dataset-creation.ts @@ -166,6 +166,9 @@ const translation = { datasetSettingLink: 'Knowledge settings.', previewChunkTip: 'Click the \'Preview Chunk\' button on the left to load the preview', previewChunkCount: '{{count}} Estimated chunks', + switch: 'Switch', + qaSwitchHighQualityTipTitle: 'Q&A Format Requires High-quality Indexing Method', + qaSwitchHighQualityTipContent: 'Currently, only high-quality index method supports Q&A format chunking. Would you like to switch to high-quality mode?', }, stepThree: { creationTitle: '🎉 Knowledge created', diff --git a/web/i18n/zh-Hans/dataset-creation.ts b/web/i18n/zh-Hans/dataset-creation.ts index c8f64777fb..5fa9beaf76 100644 --- a/web/i18n/zh-Hans/dataset-creation.ts +++ b/web/i18n/zh-Hans/dataset-creation.ts @@ -166,6 +166,9 @@ const translation = { datasetSettingLink: '知识库设置。', previewChunkTip: '点击左侧的“预览块”按钮来加载预览', previewChunkCount: '{{count}} 预估块', + switch: '切换', + qaSwitchHighQualityTipTitle: 'Q&A 格式需要高质量的索引方法', + qaSwitchHighQualityTipContent: '目前,只有高质量的索引方法支持 Q&A 格式分块。您要切换到高质量模式吗?', }, stepThree: { creationTitle: '🎉 知识库已创建',