Merge branch 'ft_wyt' of http://www.caoxiaozhu.com:13001/YG-Soft/YG_FT into ft_wyt
This commit is contained in:
@@ -283,6 +283,7 @@ export interface StartEvalPayload {
|
||||
eval_type: EvalType
|
||||
model_id: string | number
|
||||
gpu_id: string | number
|
||||
compute_node_id?: string
|
||||
dataset_id: string | number
|
||||
dimension_id: string | number
|
||||
data_source: 'dataset' | 'inference'
|
||||
|
||||
@@ -143,11 +143,15 @@ async function handleSubmit() {
|
||||
submitting.value = true
|
||||
try {
|
||||
const dimensionId = await resolveDimensionId()
|
||||
await startEval({
|
||||
// GPU 选择为「节点:GPU序号」复合值,解析出节点与 GPU 序号,
|
||||
// 多算力节点时必须把节点信息传给后端,否则会派发到错误的算力节点
|
||||
const [gpuNodeId, gpuIndex] = String(taskForm.value.gpu_id).split(':')
|
||||
const evalResult: any = await startEval({
|
||||
eval_task_name: taskForm.value.eval_task_name,
|
||||
eval_type: 'custom',
|
||||
model_id: taskForm.value.model_id,
|
||||
gpu_id: taskForm.value.gpu_id,
|
||||
gpu_id: Number(gpuIndex) || 0,
|
||||
compute_node_id: gpuNodeId || '',
|
||||
dataset_id: taskForm.value.data_source === 'dataset' ? taskForm.value.dataset_id : '',
|
||||
dimension_id: dimensionId,
|
||||
data_source: taskForm.value.data_source,
|
||||
@@ -167,6 +171,10 @@ async function handleSubmit() {
|
||||
output_precision: basicMetricForm.value.output_precision,
|
||||
},
|
||||
})
|
||||
if (evalResult?.status === 'failed' || evalResult?.error) {
|
||||
ElMessage.error(`评测启动失败:${evalResult?.error || '请检查算力节点与模型路径'}`)
|
||||
return
|
||||
}
|
||||
ElMessage.success('评测任务已创建并启动')
|
||||
router.push('/model-eval')
|
||||
} catch (error) {
|
||||
|
||||
@@ -104,9 +104,9 @@ defineExpose({ validate })
|
||||
<el-select v-model="form.gpu_id" placeholder="请选择 GPU" style="width: 100%" :loading="loading">
|
||||
<el-option
|
||||
v-for="gpu in gpus"
|
||||
:key="gpu.id"
|
||||
:label="`${gpu.name} (GPU ${gpu.id})`"
|
||||
:value="gpu.id ?? 0"
|
||||
:key="`${gpu.node_id || ''}:${gpu.id ?? 0}`"
|
||||
:label="`${gpu.node_name || gpu.node_code || '算力节点'} / ${gpu.name} (GPU ${gpu.id ?? 0})`"
|
||||
:value="`${gpu.node_id || ''}:${gpu.id ?? 0}`"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import { computed } from 'vue'
|
||||
import type { DatasetItem, GpuInfo, ModelItem, TrainedModel } from '@/types'
|
||||
import type { BasicMetricSetupDraft } from './BasicMetricSetupStep.vue'
|
||||
import type { EvalRuleSetupDraft } from './EvalRuleSetupStep.vue'
|
||||
@@ -17,6 +18,15 @@ const props = defineProps<{
|
||||
function nameOf<T extends { id: string | number; name?: string }>(items: T[], id: string | number) {
|
||||
return items.find((item) => item.id === id)?.name || String(id || '-')
|
||||
}
|
||||
|
||||
/** GPU 选择为「节点:GPU序号」复合值,解析并展示为可读标签 */
|
||||
const gpuLabel = computed(() => {
|
||||
const key = String(props.task.gpu_id || '')
|
||||
const gpu = props.gpus.find((g) => `${g.node_id || ''}:${g.id ?? 0}` === key)
|
||||
if (gpu) return `${gpu.node_name || gpu.node_code || '算力节点'} / GPU ${gpu.id ?? 0}`
|
||||
const [nodeId, idx] = key.split(':')
|
||||
return nodeId ? `节点 ${nodeId} / GPU ${idx || 0}` : `GPU ${key || 0}`
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -24,7 +34,7 @@ function nameOf<T extends { id: string | number; name?: string }>(items: T[], id
|
||||
<el-descriptions :column="2" border>
|
||||
<el-descriptions-item label="Task">{{ props.task.eval_task_name || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="Model">{{ nameOf(props.trainedModels, props.task.model_id) }}</el-descriptions-item>
|
||||
<el-descriptions-item label="GPU">GPU {{ props.task.gpu_id || 0 }}</el-descriptions-item>
|
||||
<el-descriptions-item label="GPU">{{ gpuLabel }}</el-descriptions-item>
|
||||
<el-descriptions-item label="Dataset">
|
||||
{{ props.task.data_source === 'dataset' ? nameOf(props.evalDatasets, props.task.dataset_id) : 'Inference results' }}
|
||||
</el-descriptions-item>
|
||||
|
||||
Reference in New Issue
Block a user