feat(data-process): 优化上传切分流程与PDF高亮预览
This commit is contained in:
@@ -84,6 +84,12 @@ const configLabelMap: Record<string, string> = {
|
||||
preserve_lists: '保留列表',
|
||||
}
|
||||
|
||||
const chunkMethodLabelMap: Record<string, string> = {
|
||||
structure: '文档结构',
|
||||
fixed: '固定 Token',
|
||||
custom: '自定义分隔符',
|
||||
}
|
||||
|
||||
function numeric(value: number | undefined) {
|
||||
return Number.isFinite(value) ? Number(value) : 0
|
||||
}
|
||||
@@ -135,6 +141,9 @@ const configRows = computed(() => Object.entries(detail.value?.config || {})
|
||||
})))
|
||||
|
||||
function formatConfigValue(key: string, value: unknown) {
|
||||
if (key === 'chunk_method' && typeof value === 'string') {
|
||||
return chunkMethodLabelMap[value] || value
|
||||
}
|
||||
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