Skip to content

Commit

Permalink
feat: Add top_n to DeepLForm infiniflow#1739 (infiniflow#2629)
Browse files Browse the repository at this point in the history
### What problem does this PR solve?

feat: Add top_n to DeepLForm infiniflow#1739

### Type of change

- [ ] Bug Fix (non-breaking change which fixes an issue)
- [x] New Feature (non-breaking change which adds functionality)
- [ ] Documentation Update
- [ ] Refactoring
- [ ] Performance Improvement
- [ ] Other (please describe):
  • Loading branch information
cike8899 authored Sep 27, 2024
1 parent 96f56a3 commit a246e56
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion web/src/pages/flow/constant.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ export const initialGoogleScholarValues = {
};

export const initialDeepLValues = {
text: 5,
top_n: 5,
auth_key: 'relevance',
};

Expand Down
7 changes: 3 additions & 4 deletions web/src/pages/flow/deepl-form/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import TopNItem from '@/components/top-n-item';
import { useTranslate } from '@/hooks/common-hooks';
import { Form, InputNumber, Select } from 'antd';
import { Form, Select } from 'antd';
import { DeepLSourceLangOptions, DeepLTargetLangOptions } from '../constant';
import { useBuildSortOptions } from '../form-hooks';
import { IOperatorForm } from '../interface';
Expand All @@ -17,9 +18,7 @@ const DeepLForm = ({ onValuesChange, form }: IOperatorForm) => {
form={form}
onValuesChange={onValuesChange}
>
<Form.Item label={t('text')} name={'text'}>
<InputNumber></InputNumber>
</Form.Item>
<TopNItem initialValue={5}></TopNItem>
<Form.Item label={t('authKey')} name={'auth_key'}>
<Select options={options}></Select>
</Form.Item>
Expand Down

0 comments on commit a246e56

Please sign in to comment.