|
|
@@ -39,7 +39,8 @@ const QuestionAnswerInfo: React.FC = () => {
|
|
|
min={0}
|
|
|
max={1}
|
|
|
onChange={onChange}
|
|
|
- value={typeof topPValue === 'number' ? topPValue : 0}
|
|
|
+ // value={typeof topPValue === 'number' ? topPValue : 0}
|
|
|
+ value={topPValue}
|
|
|
step={0.1}
|
|
|
/>
|
|
|
</Col>
|
|
|
@@ -73,7 +74,8 @@ const QuestionAnswerInfo: React.FC = () => {
|
|
|
min={0}
|
|
|
max={1}
|
|
|
onChange={onChange}
|
|
|
- value={typeof tempValue === 'number' ? tempValue : 0}
|
|
|
+ // value={typeof tempValue === 'number' ? tempValue : 0}
|
|
|
+ value={tempValue}
|
|
|
step={0.01}
|
|
|
/>
|
|
|
</Col>
|
|
|
@@ -157,21 +159,21 @@ const QuestionAnswerInfo: React.FC = () => {
|
|
|
// console.log('changed', value);
|
|
|
// };
|
|
|
|
|
|
- // const onChangeShow = (checked: boolean) => {
|
|
|
- // console.log(`switch to ${checked}`);
|
|
|
- // };
|
|
|
+ const onChangeShow = (checked: boolean) => {
|
|
|
+ console.log(`switch to ${checked}`);
|
|
|
+ };
|
|
|
|
|
|
- // const onChangeModel = (checked: boolean) => {
|
|
|
- // setIsVisibleRerank(!isVisibleRerank);
|
|
|
- // };
|
|
|
+ const onChangeModel = (checked: boolean) => {
|
|
|
+ setIsVisibleRerank(!isVisibleRerank);
|
|
|
+ };
|
|
|
|
|
|
- // const onChangeCount = (value: string) => {
|
|
|
- // if (value === 'fixed') {
|
|
|
- // setIsVisibleSlice(!isVisibleSlice);
|
|
|
- // } else {
|
|
|
- // setIsVisibleSlice(false);
|
|
|
- // }
|
|
|
- // };
|
|
|
+ const onChangeCount = (value: string) => {
|
|
|
+ if (value === 'fixed') {
|
|
|
+ setIsVisibleSlice(!isVisibleSlice);
|
|
|
+ } else {
|
|
|
+ setIsVisibleSlice(false);
|
|
|
+ }
|
|
|
+ };
|
|
|
|
|
|
// 召回方式
|
|
|
const onChangeRecallMethod = (e: RadioChangeEvent) => {
|
|
|
@@ -184,60 +186,84 @@ const QuestionAnswerInfo: React.FC = () => {
|
|
|
setPageLoading(true);
|
|
|
try {
|
|
|
const res = await apis.fetchApplicationDetail(app_id)
|
|
|
+ console.log(res.data);
|
|
|
const sd = res.data.questionlist.map((item: any, index: number) => {
|
|
|
return {
|
|
|
"id": index + 1,
|
|
|
"value": item.question,
|
|
|
}
|
|
|
});
|
|
|
+
|
|
|
const info = res.data.detail;
|
|
|
- if (info.paramDesc === 'custom') {
|
|
|
- setIsVisibleCus(!isVisibleCus); //自定义回答风格
|
|
|
- }
|
|
|
- // if (jsonObj.rerank_status === 1) {
|
|
|
- // setIsVisibleRerank(!isVisibleRerank) //模型
|
|
|
- // }
|
|
|
- // //召回切片数量
|
|
|
- // if (jsonObj.slice_config_type === 'fixed') {
|
|
|
- // setIsVisibleSlice(!isVisibleSlice);
|
|
|
- // }else {
|
|
|
- // setIsVisibleSlice(false);
|
|
|
- // }
|
|
|
- setTopPValue(info.topP as number);
|
|
|
+ console.log(info, 'info-info');
|
|
|
+ setTopPValue(info.top_p as number);
|
|
|
setTempValue(info.temperature as number);
|
|
|
setName(info.name);
|
|
|
|
|
|
+ interface Item2 {
|
|
|
+ index_type_id: number,
|
|
|
+ knowledge_id: string
|
|
|
+ }
|
|
|
+
|
|
|
+ interface Item {
|
|
|
+ show_recall_result: boolean,
|
|
|
+ recall_method: string,
|
|
|
+ rerank_status: boolean,
|
|
|
+ slice_config_type: string,
|
|
|
+ slice_count: number,
|
|
|
+ recall_slice_splicing_method: string,
|
|
|
+ param_desc: string,
|
|
|
+ rerank_model_name: string,
|
|
|
+ rerank_index_type_list: [Item2],
|
|
|
+ recall_index_type_list: [Item2]
|
|
|
+ }
|
|
|
+ const data_info: Item = JSON.parse(info.knowledgeInfo === '' ? '{}' : info.knowledgeInfo);
|
|
|
+
|
|
|
+ if (data_info && typeof data_info === 'object' && data_info.param_desc === 'custom') {
|
|
|
+ setIsVisibleCus(!isVisibleCus); //自定义回答风格
|
|
|
+ }
|
|
|
+ if (data_info && typeof data_info === 'object' && data_info.rerank_status === true) {
|
|
|
+ setIsVisibleRerank(!isVisibleRerank) //模型
|
|
|
+ }
|
|
|
+ //召回切片数量
|
|
|
+ if (data_info && typeof data_info === 'object' && data_info.slice_config_type === 'fixed') {
|
|
|
+ setIsVisibleSlice(!isVisibleSlice);
|
|
|
+ } else {
|
|
|
+ setIsVisibleSlice(false);
|
|
|
+ }
|
|
|
+
|
|
|
form.setFieldsValue({
|
|
|
id: info.id,
|
|
|
name: info.name, //应用名称
|
|
|
desc: info.desc, //应用描述
|
|
|
prompt: info.prompt, //应用提示语
|
|
|
- top_p: info.top_p, //topP
|
|
|
- temperature: info.temperature, //温度
|
|
|
+ top_p: info.top_p as number, //topP
|
|
|
+ temperature: info.temperature as number, //温度
|
|
|
knowledge_ids: info.knowledge_ids,
|
|
|
- slice_count: info.slice_count,
|
|
|
model: info.model,
|
|
|
icon_color: info.icon_color,
|
|
|
icon_type: info.icon_type,
|
|
|
questionList: sd, //问题列表
|
|
|
- // max_token: info.max_token, //应用最大token
|
|
|
- // updateDate: info.updateDate, // 更新时间
|
|
|
- // param_desc: info.paramDesc, //回答风格
|
|
|
- // questionList: sd, //问题列表
|
|
|
- // knowledge_ids: jsonObj.knowledge_ids, //知识库id
|
|
|
- // model: jsonObj.model, //模型名称
|
|
|
- // slice_config_type: jsonObj.slice_config_type, //切片类型
|
|
|
- // recall_method: jsonObj.recall_method, //召回方式
|
|
|
- // slice_count: jsonObj.slice_count, //切片数量
|
|
|
- // rerank_model_name: jsonObj.rerank_model_name, //模型名称
|
|
|
- // recall_slice_splicing_method: jsonObj.recall_slice_splicing_method,
|
|
|
- // rerank_status: jsonObj.rerank_status, //开启rerank
|
|
|
- // show_recall_result: jsonObj.show_recall_result, //是否展示召回结果
|
|
|
- // recall_index_type_list: jsonObj.recall_index_type_list, //知识库id
|
|
|
- // rerank_index_type_list: jsonObj.rerank_index_type_list, //知识库id
|
|
|
+ max_token: info.maxToken, //应用最大token
|
|
|
+ updateDate: info.updateDate, // 更新时间
|
|
|
+
|
|
|
+ param_desc: data_info && data_info.param_desc, //回答风格
|
|
|
+ show_recall_result: data_info && data_info.show_recall_result, //是否展示召回结果
|
|
|
+ recall_method: data_info && data_info.recall_method, //召回方式
|
|
|
+ rerank_status: data_info && data_info.rerank_status, //开启rerank
|
|
|
+ rerank_model_name: data_info && data_info.rerank_model_name, //模型名称
|
|
|
+ slice_config_type: data_info && data_info.slice_config_type, // 召回切片数量
|
|
|
+ slice_count: data_info && data_info.slice_count, // 切片数量
|
|
|
+ recall_slice_splicing_method: data_info && data_info.recall_slice_splicing_method, // 切片内容
|
|
|
+
|
|
|
+ // rerank_status = 1 rerank_index_type_list
|
|
|
+ // recall_method = 'embedding' || 'mixed' recall_index_type_list
|
|
|
+ //recall_index_type_list: info.recall_index_type_list, //知识库id
|
|
|
+ //rerank_index_type_list: info.rerank_index_type_list, //知识库id
|
|
|
})
|
|
|
- console.log(sd, 'sd');
|
|
|
- setInputs(sd);
|
|
|
+ if (sd.length > 0) {
|
|
|
+ setInputs(sd);
|
|
|
+ }
|
|
|
} catch (error) {
|
|
|
console.error(error);
|
|
|
} finally {
|
|
|
@@ -281,6 +307,16 @@ const QuestionAnswerInfo: React.FC = () => {
|
|
|
|
|
|
const handleRedioClick = (value: string) => {
|
|
|
setIsVisibleCus(false);
|
|
|
+ // if (value === 'strict') {
|
|
|
+ // setTopPValue(0.5);
|
|
|
+ // setTempValue(0.10);
|
|
|
+ // } else if (value === 'moderate') {
|
|
|
+ // setTopPValue(0.7);
|
|
|
+ // setTempValue(0.50);
|
|
|
+ // } else if (value === 'flexib') {
|
|
|
+ // setTopPValue(0.9);
|
|
|
+ // setTempValue(0.90);
|
|
|
+ // }
|
|
|
}
|
|
|
|
|
|
return (
|
|
|
@@ -366,38 +402,61 @@ const QuestionAnswerInfo: React.FC = () => {
|
|
|
onClick={() => {
|
|
|
form.validateFields().then(async (values) => {
|
|
|
const data = values;
|
|
|
+ // 问题列表
|
|
|
const question: string[] = [];
|
|
|
if (inputs) {
|
|
|
inputs.map((item, index) => {
|
|
|
question.push(item.value);
|
|
|
});
|
|
|
}
|
|
|
- console.log(question, 'question');
|
|
|
+ interface Item {
|
|
|
+ index_type_id: number,
|
|
|
+ knowledge_id: string
|
|
|
+ }
|
|
|
+ const indexTypeList: Item[] = [];
|
|
|
+ if (values.knowledge_ids && values.knowledge_ids.length > 0) {
|
|
|
+ values.knowledge_ids.map((item: string, index: any) => {
|
|
|
+ console.log(item, 'item');
|
|
|
+ const index_type: Item = {
|
|
|
+ index_type_id: index,
|
|
|
+ knowledge_id: item,
|
|
|
+ };
|
|
|
+ indexTypeList.push(index_type);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ const data_info = {
|
|
|
+ param_desc: values.param_desc === undefined ? '' : values.param_desc, //回答风格
|
|
|
+ show_recall_result: values.show_recall_result === undefined ? '' : values.show_recall_result, //是否展示召回结果
|
|
|
+ recall_method: values.recall_method === undefined ? '' : values.recall_method, //召回方式
|
|
|
+ rerank_status: values.rerank_status === undefined ? 0 : values.rerank_status === true ? 1 : 0, //开启rerank
|
|
|
+ rerank_model_name: values.rerank_model_name === undefined ? '' : values.rerank_model_name, //模型名称
|
|
|
+ slice_config_type: values.slice_config_type === undefined ? '' : values.slice_config_type, // 召回切片数量
|
|
|
+ slice_count: values.slice_count === undefined ? '' : values.slice_count, // 切片数量
|
|
|
+ recall_slice_splicing_method: values.recall_slice_splicing_method === undefined ? '' : values.recall_slice_splicing_method, // 切片内容
|
|
|
+ rerank_index_type_list: values.rerank_status === true ? indexTypeList : [], //知识库id
|
|
|
+ recall_index_type_list: values.recall_method === undefined ? [] : values.recall_method === 'embedding' || 'mixed' ? indexTypeList : [],
|
|
|
+ embedding_recall_ratio: 0 //向量化检索比例
|
|
|
+ // rerank_status = 1 rerank_index_type_list
|
|
|
+ // recall_method = 'embedding' || 'embedding' recall_index_type_list
|
|
|
+ };
|
|
|
+ // const knowledgeIds: string[] = [];
|
|
|
+ // knowledgeIds.push(values.knowledge_ids);
|
|
|
+ console.log(data_info, 'data_info');
|
|
|
const info = {
|
|
|
id: values.id,
|
|
|
name: values.name, //应用名称
|
|
|
desc: values.desc, //应用描述
|
|
|
prompt: values.prompt, //应用提示语
|
|
|
- top_p: values.top_p, //topP
|
|
|
- temperature: values.temperature, //温度
|
|
|
+ top_p: topPValue.toString(), //topP
|
|
|
+ temperature: tempValue.toString(), //温度
|
|
|
knowledge_ids: values.knowledge_ids,
|
|
|
slice_count: values.slice_count,
|
|
|
model: values.model,
|
|
|
icon_color: values.icon_color,
|
|
|
icon_type: values.icon_type,
|
|
|
questionList: question,
|
|
|
- // knowledge_info: {
|
|
|
- // model: values.model, // 默认模型名称
|
|
|
- // knowledge_ids: values.knowledge_ids, // 知识库id列表
|
|
|
- // slice_config_type: values.slice_config_type, // 切片类型,默认为 fixed
|
|
|
- // recall_method: values.recall_method, // 召回方式,默认为 embedding
|
|
|
- // recall_index_type_list: values.recall_index_type_list, // 索引配置类型列表,默认为空数组
|
|
|
- // slice_count: values.slice_count, // 切片数量,默认为空字符串
|
|
|
- // rerank_status: values.rerank_status ? 1 : 0, // 是否开启rerank,默认关闭
|
|
|
- // rerank_model_name: values.rerank_model_name, // 模型名称,默认为空字符串
|
|
|
- // show_recall_result: values.show_recall_result, // 是否展示召回结果,默认为空字符串
|
|
|
- // recall_slice_splicing_method: values.recall_slice_splicing_method // 召回切片拼接方式,默认为空字符串
|
|
|
- // }
|
|
|
+ knowledge_info: data_info,
|
|
|
+ max_token: values.max_token, //应用最大token
|
|
|
};
|
|
|
const id = location?.state?.id;
|
|
|
let res = null;
|
|
|
@@ -411,10 +470,15 @@ const QuestionAnswerInfo: React.FC = () => {
|
|
|
if (res.data.code !== 200) {
|
|
|
message.error(res.data.message);
|
|
|
} else {
|
|
|
+ message.success('修改成功');
|
|
|
router.navigate({ pathname: '/questionAnswer' });
|
|
|
}
|
|
|
}).catch((error) => {
|
|
|
console.error(error);
|
|
|
+ error.errorFields && error.errorFields.map((item: any) => {
|
|
|
+ console.log(item, 'item');
|
|
|
+ message.error(`字段 ${item.name} ${item.errors[0]}`);
|
|
|
+ });
|
|
|
});
|
|
|
}}
|
|
|
>发布应用</Button>
|
|
|
@@ -507,7 +571,7 @@ const QuestionAnswerInfo: React.FC = () => {
|
|
|
</FormItem>
|
|
|
</div>
|
|
|
|
|
|
- {/* {
|
|
|
+ {
|
|
|
!isVisible &&
|
|
|
<div style={{ display: 'flex', justifyContent: 'center', alignItems: 'center' }}>
|
|
|
<a onClick={() => {
|
|
|
@@ -517,152 +581,154 @@ const QuestionAnswerInfo: React.FC = () => {
|
|
|
</a>
|
|
|
</div>
|
|
|
|
|
|
- } */}
|
|
|
-
|
|
|
- {/* {isVisible &&
|
|
|
- <div>
|
|
|
- {isVisibleCus &&
|
|
|
- <Space style={{ width: '100%' }} direction="vertical">
|
|
|
- <div style={{ display: 'flex', justifyContent: 'center', alignItems: 'center' }}>
|
|
|
- <FormItem
|
|
|
- label='Top-p'
|
|
|
- name='topP'
|
|
|
- style={{ width: '300px' }}
|
|
|
- >
|
|
|
- <TopPDecimalStep />
|
|
|
- </FormItem>
|
|
|
- </div>
|
|
|
- <div style={{ display: 'flex', justifyContent: 'center', alignItems: 'center' }}>
|
|
|
- <FormItem
|
|
|
- label='Temperature'
|
|
|
- name='temperature'
|
|
|
- style={{ width: '300px' }}
|
|
|
- >
|
|
|
- <TempDecimalStep />
|
|
|
- </FormItem>
|
|
|
- </div>
|
|
|
- </Space >
|
|
|
- }
|
|
|
+ }
|
|
|
|
|
|
- <div style={{ display: 'flex', justifyContent: 'center', alignItems: 'center' }}>
|
|
|
- <FormItem
|
|
|
- label='回答风格'
|
|
|
- name='param_desc'
|
|
|
- rules={[{ required: true, message: '回答风格不能为空' }]}>
|
|
|
- <Radio.Group buttonStyle="solid"
|
|
|
- className='questionAnswerInfo-content-title'>
|
|
|
- <Radio.Button onClick={() => {
|
|
|
- handleRedioClick('')
|
|
|
- }} value='strict'>严谨</Radio.Button>
|
|
|
- <Radio.Button onClick={() => {
|
|
|
- handleRedioClick('')
|
|
|
- }} value='moderate'>适中</Radio.Button>
|
|
|
- <Radio.Button onClick={() => {
|
|
|
- handleRedioClick('')
|
|
|
- }} value='flexib'>发散</Radio.Button>
|
|
|
- <Radio.Button value='custom'
|
|
|
- onClick={() => {
|
|
|
- setIsVisibleCus(!isVisibleCus);
|
|
|
- }}
|
|
|
- >自定义
|
|
|
- </Radio.Button>
|
|
|
- </Radio.Group>
|
|
|
- </FormItem>
|
|
|
- </div>
|
|
|
- <div style={{ display: 'flex', justifyContent: 'center', alignItems: 'center' }}>
|
|
|
- <FormItem
|
|
|
- label='展示引用知识'
|
|
|
- name='show_recall_result'
|
|
|
- className='questionAnswerInfo-content-title'>
|
|
|
- <Switch onChange={onChangeShow} />
|
|
|
- </FormItem>
|
|
|
- </div>
|
|
|
- <div style={{ display: 'flex', justifyContent: 'center', alignItems: 'center' }}>
|
|
|
- <FormItem
|
|
|
- label='召回方式'
|
|
|
- name='recall_method'
|
|
|
- rules={[{ required: true, message: '召回方式不能为空' }]}>
|
|
|
-
|
|
|
- <Radio.Group
|
|
|
- style={style}
|
|
|
- onChange={onChangeRecallMethod}
|
|
|
- options={[
|
|
|
- { value: 'embedding', label: '向量化检索' },
|
|
|
- { value: 'keyword', label: '关键词检索' },
|
|
|
- { value: 'mixed', label: '混合检索' },
|
|
|
- ]}
|
|
|
- />
|
|
|
- </FormItem>
|
|
|
- </div>
|
|
|
- <div style={{ display: 'flex', justifyContent: 'center', alignItems: 'center' }}>
|
|
|
- <p className='questionAnswerInfo-content-title'>重排方式</p>
|
|
|
-
|
|
|
- </div>
|
|
|
- <div style={{ display: 'flex', justifyContent: 'center', alignItems: 'center' }}>
|
|
|
- <FormItem
|
|
|
- label='Rerank模型'
|
|
|
- name='rerank_status'
|
|
|
- valuePropName='checked'
|
|
|
- className='questionAnswerInfo-content-title'
|
|
|
- >
|
|
|
- <Switch onChange={onChangeModel} />
|
|
|
- </FormItem>
|
|
|
- </div>
|
|
|
- {isVisibleRerank &&
|
|
|
+ {/* {isVisible && */}
|
|
|
+ <div style={{ display: isVisible ? 'block' : 'none', paddingTop: '20px' }}>
|
|
|
+ {isVisibleCus &&
|
|
|
+ <Space style={{ width: '100%' }} direction="vertical">
|
|
|
+ <div style={{ display: 'flex', justifyContent: 'center', alignItems: 'center' }}>
|
|
|
+ <FormItem
|
|
|
+ label='Top-p'
|
|
|
+ name='topP'
|
|
|
+ style={{ width: '300px' }}
|
|
|
+ >
|
|
|
+ <TopPDecimalStep />
|
|
|
+ </FormItem>
|
|
|
+ </div>
|
|
|
<div style={{ display: 'flex', justifyContent: 'center', alignItems: 'center' }}>
|
|
|
<FormItem
|
|
|
- label='模型选择'
|
|
|
- name='rerank_model_name'
|
|
|
+ label='Temperature'
|
|
|
+ name='temperature'
|
|
|
+ style={{ width: '300px' }}
|
|
|
>
|
|
|
- <Select
|
|
|
- style={{ width: '300px', height: '48px' }}
|
|
|
- placeholder='请选择模型'
|
|
|
- defaultValue={'默认rerank模型'}
|
|
|
- >
|
|
|
- <Option value='rerank'>默认rerank模型</Option>
|
|
|
- </Select>
|
|
|
+ <TempDecimalStep />
|
|
|
</FormItem>
|
|
|
</div>
|
|
|
- }
|
|
|
+ </Space >
|
|
|
+ }
|
|
|
+
|
|
|
+ <div style={{ display: 'flex', justifyContent: 'center', alignItems: 'center' }}>
|
|
|
+ <FormItem
|
|
|
+ label='回答风格'
|
|
|
+ name='param_desc'
|
|
|
+ rules={[{ required: true, message: '回答风格不能为空' }]}>
|
|
|
+ <Radio.Group buttonStyle="solid"
|
|
|
+ className='questionAnswerInfo-content-title'>
|
|
|
+ <Radio.Button onClick={() => {
|
|
|
+ handleRedioClick('strict')
|
|
|
+ }} value='strict'>严谨</Radio.Button>
|
|
|
+ <Radio.Button onClick={() => {
|
|
|
+ handleRedioClick('moderate')
|
|
|
+ }} value='moderate'>适中</Radio.Button>
|
|
|
+ <Radio.Button onClick={() => {
|
|
|
+ handleRedioClick('flexib')
|
|
|
+ }} value='flexib'>发散</Radio.Button>
|
|
|
+ <Radio.Button value='custom'
|
|
|
+ onClick={() => {
|
|
|
+ setIsVisibleCus(!isVisibleCus);
|
|
|
+ setTopPValue(0.1);
|
|
|
+ setTempValue(0.01);
|
|
|
+ }}
|
|
|
+ >自定义
|
|
|
+ </Radio.Button>
|
|
|
+ </Radio.Group>
|
|
|
+ </FormItem>
|
|
|
+ </div>
|
|
|
+ <div style={{ display: 'flex', justifyContent: 'center', alignItems: 'center' }}>
|
|
|
+ <FormItem
|
|
|
+ label='展示引用知识'
|
|
|
+ name='show_recall_result'
|
|
|
+ className='questionAnswerInfo-content-title'>
|
|
|
+ <Switch onChange={onChangeShow} />
|
|
|
+ </FormItem>
|
|
|
+ </div>
|
|
|
+ <div style={{ display: 'flex', justifyContent: 'center', alignItems: 'center' }}>
|
|
|
+ <FormItem
|
|
|
+ label='召回方式'
|
|
|
+ name='recall_method'
|
|
|
+ rules={[{ required: true, message: '召回方式不能为空' }]}>
|
|
|
+
|
|
|
+ <Radio.Group
|
|
|
+ style={style}
|
|
|
+ onChange={onChangeRecallMethod}
|
|
|
+ options={[
|
|
|
+ { value: 'embedding', label: '向量化检索' },
|
|
|
+ { value: 'keyword', label: '关键词检索' },
|
|
|
+ { value: 'mixed', label: '混合检索' },
|
|
|
+ ]}
|
|
|
+ />
|
|
|
+ </FormItem>
|
|
|
+ </div>
|
|
|
+ <div style={{ display: 'flex', justifyContent: 'center', alignItems: 'center' }}>
|
|
|
+ <p className='questionAnswerInfo-content-title'>重排方式</p>
|
|
|
+
|
|
|
+ </div>
|
|
|
+ <div style={{ display: 'flex', justifyContent: 'center', alignItems: 'center' }}>
|
|
|
+ <FormItem
|
|
|
+ label='Rerank模型'
|
|
|
+ name='rerank_status'
|
|
|
+ valuePropName='checked'
|
|
|
+ className='questionAnswerInfo-content-title'
|
|
|
+ >
|
|
|
+ <Switch onChange={onChangeModel} />
|
|
|
+ </FormItem>
|
|
|
+ </div>
|
|
|
+ {isVisibleRerank &&
|
|
|
<div style={{ display: 'flex', justifyContent: 'center', alignItems: 'center' }}>
|
|
|
<FormItem
|
|
|
- label='召回切片数量'
|
|
|
- name='slice_config_type'
|
|
|
- rules={[{ required: true, message: '召回方式不能为空' }]}>
|
|
|
+ label='模型选择'
|
|
|
+ name='rerank_model_name'
|
|
|
+ >
|
|
|
<Select
|
|
|
style={{ width: '300px', height: '48px' }}
|
|
|
- placeholder='请选择'
|
|
|
- onChange={onChangeCount}>
|
|
|
- <Option value="fixed">手动设置</Option>
|
|
|
- <Option value="customized">自动设置</Option>
|
|
|
+ placeholder='请选择模型'
|
|
|
+ defaultValue={'默认rerank模型'}
|
|
|
+ >
|
|
|
+ <Option value='rerank'>默认rerank模型</Option>
|
|
|
</Select>
|
|
|
</FormItem>
|
|
|
</div>
|
|
|
+ }
|
|
|
+ <div style={{ display: 'flex', justifyContent: 'center', alignItems: 'center' }}>
|
|
|
+ <FormItem
|
|
|
+ label='召回切片数量'
|
|
|
+ name='slice_config_type'
|
|
|
+ rules={[{ required: true, message: '召回方式不能为空' }]}>
|
|
|
+ <Select
|
|
|
+ style={{ width: '300px', height: '48px' }}
|
|
|
+ placeholder='请选择'
|
|
|
+ onChange={onChangeCount}>
|
|
|
+ <Option value="fixed">手动设置</Option>
|
|
|
+ <Option value="customized">自动设置</Option>
|
|
|
+ </Select>
|
|
|
+ </FormItem>
|
|
|
+ </div>
|
|
|
|
|
|
- {isVisibleSlice &&
|
|
|
- <div style={{ display: 'flex', justifyContent: 'center', alignItems: 'center' }}>
|
|
|
- <FormItem
|
|
|
- label='召回切片数'
|
|
|
- name='slice_count'
|
|
|
- rules={[{ required: true, message: '切片数不能为空' }]}>
|
|
|
- <InputNumber max={1024} changeOnWheel className='questionAnswerInfo-content-title' />
|
|
|
- </FormItem>
|
|
|
- </div>
|
|
|
- }
|
|
|
+ {isVisibleSlice &&
|
|
|
<div style={{ display: 'flex', justifyContent: 'center', alignItems: 'center' }}>
|
|
|
<FormItem
|
|
|
- label='召回切片拼接方式'
|
|
|
- name='recall_slice_splicing_method'
|
|
|
- >
|
|
|
- <TextArea
|
|
|
- rows={4}
|
|
|
- className='questionAnswerInfo-content-title'
|
|
|
- placeholder="请输入内容"
|
|
|
- />
|
|
|
+ label='召回切片数'
|
|
|
+ name='slice_count'
|
|
|
+ rules={[{ required: true, message: '切片数不能为空' }]}>
|
|
|
+ <InputNumber max={1024} changeOnWheel className='questionAnswerInfo-content-title' />
|
|
|
</FormItem>
|
|
|
</div>
|
|
|
+ }
|
|
|
+ <div style={{ display: 'flex', justifyContent: 'center', alignItems: 'center' }}>
|
|
|
+ <FormItem
|
|
|
+ label='召回切片拼接方式'
|
|
|
+ name='recall_slice_splicing_method'
|
|
|
+ >
|
|
|
+ <TextArea
|
|
|
+ rows={4}
|
|
|
+ className='questionAnswerInfo-content-title'
|
|
|
+ placeholder="请输入内容"
|
|
|
+ />
|
|
|
+ </FormItem>
|
|
|
</div>
|
|
|
- } */}
|
|
|
+ </div>
|
|
|
+ {/* } */}
|
|
|
</div>
|
|
|
</div>
|
|
|
</Splitter.Panel>
|