feat(data-process): 增加可配置思维链生成
This commit is contained in:
@@ -71,6 +71,7 @@ const configLabelMap: Record<string, string> = {
|
||||
generation_model_id: '数据生成模型',
|
||||
generation_prompt: '生成提示语',
|
||||
output_type: '输出类型',
|
||||
reasoning_detail: '推理详细程度',
|
||||
temperature: '生成温度',
|
||||
max_tokens: '最大输出长度',
|
||||
json_mode: 'JSON 输出',
|
||||
@@ -225,15 +226,19 @@ const durationText = computed(() => {
|
||||
return minutes ? `${minutes} 分 ${restSeconds} 秒` : `${restSeconds} 秒`
|
||||
})
|
||||
|
||||
const configRows = computed(() => Object.entries(detail.value?.config || {})
|
||||
.filter(([key]) => (
|
||||
key !== 'generation_model_snapshot'
|
||||
&& !/(?:password|secret|token|api_key)/i.test(key)
|
||||
))
|
||||
.map(([key, value]) => ({
|
||||
label: configLabelMap[key] || key.split('_').join(' '),
|
||||
value: formatConfigValue(key, value),
|
||||
})))
|
||||
const configRows = computed(() => {
|
||||
const config = detail.value?.config || {}
|
||||
return Object.entries(config)
|
||||
.filter(([key]) => (
|
||||
key !== 'generation_model_snapshot'
|
||||
&& (key !== 'reasoning_detail' || config.output_type === 'reasoning')
|
||||
&& !/(?:password|secret|token|api_key)/i.test(key)
|
||||
))
|
||||
.map(([key, value]) => ({
|
||||
label: configLabelMap[key] || key.split('_').join(' '),
|
||||
value: formatConfigValue(key, value),
|
||||
}))
|
||||
})
|
||||
|
||||
function formatConfigValue(key: string, value: unknown) {
|
||||
if (key === 'generation_model_id') {
|
||||
@@ -249,6 +254,9 @@ function formatConfigValue(key: string, value: unknown) {
|
||||
if (key === 'output_type') {
|
||||
return value === 'reasoning' ? '思维链回答' : '标准回答'
|
||||
}
|
||||
if (key === 'reasoning_detail') {
|
||||
return value === 'detailed' ? '详细推理' : '普通推理'
|
||||
}
|
||||
if (key === 'dataset_split' && value && typeof value === 'object') {
|
||||
const split = value as Partial<DataProcessDatasetSplit>
|
||||
return `训练集 ${split.train ?? 0}% / 验证集 ${split.validation ?? 0}% / 测试集 ${split.test ?? 0}%`
|
||||
|
||||
Reference in New Issue
Block a user