fix: remove Top K in retrieval testing #770 and if the document parsing fails, the error message returned by the backend is displayed (#782)

### What problem does this PR solve?

fix: remove Top K in retrieval testing  #770
fix: if the document parsing fails, the error message returned by the
backend is displayed.

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
balibabu
2024-05-15 13:58:30 +08:00
committed by GitHub
parent 4d47b2b459
commit 5effbfac80
5 changed files with 37 additions and 20 deletions

View File

@ -1,5 +1,5 @@
import SimilaritySlider from '@/components/similarity-slider';
import { Button, Card, Divider, Flex, Form, Input, Slider } from 'antd';
import { Button, Card, Divider, Flex, Form, Input } from 'antd';
import { FormInstance } from 'antd/lib';
import { useTranslate } from '@/hooks/commonHooks';
@ -9,7 +9,6 @@ import styles from './index.less';
type FieldType = {
similarity_threshold?: number;
vector_similarity_weight?: number;
top_k?: number;
question: string;
};
@ -36,22 +35,8 @@ const TestingControl = ({ form, handleTesting }: IProps) => {
<p>{t('testingDescription')}</p>
<Divider></Divider>
<section>
<Form
name="testing"
layout="vertical"
form={form}
initialValues={{
top_k: 1024,
}}
>
<Form name="testing" layout="vertical" form={form}>
<SimilaritySlider isTooltipShown></SimilaritySlider>
<Form.Item<FieldType>
label="Top K"
name={'top_k'}
tooltip={t('topKTip')}
>
<Slider marks={{ 0: 0, 2048: 2048 }} max={2048} />
</Form.Item>
<Card size="small" title={t('testText')}>
<Form.Item<FieldType>
name={'question'}