Browse Source

提交代码。

Signed-off-by: zouap <zouap@pcl.ac.cn>
tags/v1.22.11.2^2
zouap 3 years ago
parent
commit
47829808c0
1 changed files with 5 additions and 15 deletions
  1. +5
    -15
      routers/repo/ai_model_manage.go

+ 5
- 15
routers/repo/ai_model_manage.go View File

@@ -76,24 +76,14 @@ func saveModelByParameters(jobId string, versionName string, name string, versio
//download model zip //train type
if aiTask.ComputeResource == models.NPUResource {
cloudType = models.TypeCloudBrainTwo
spec, err := resource.GetCloudbrainSpec(aiTask.ID)
if err == nil {
flaverName := "NPU: " + fmt.Sprint(spec.AccCardsNum) + "*" + spec.AccCardType + ",CPU: " + fmt.Sprint(spec.CpuCores) + ","
if spec.GPUMemGiB > 0 {
flaverName += ctx.Tr("cloudbrain.gpu_memory") + ": " + fmt.Sprint(spec.GPUMemGiB) + "GB,"
}
flaverName += ctx.Tr("cloudbrain.memory") + ": " + fmt.Sprint(spec.MemGiB) + "GB"
aiTask.FlavorName = flaverName
}
} else if aiTask.ComputeResource == models.GPUResource {
cloudType = models.TypeCloudBrainOne
spec, err := resource.GetCloudbrainSpec(aiTask.ID)
if err == nil {
flaverName := "GPU: " + fmt.Sprint(spec.AccCardsNum) + "*" + spec.AccCardType + ",CPU: " + fmt.Sprint(spec.CpuCores) + "," + ctx.Tr("cloudbrain.memory") + ": " + fmt.Sprint(spec.MemGiB) + "GB," + ctx.Tr("cloudbrain.shared_memory") + ": " + fmt.Sprint(spec.ShareMemGiB) + "GB"
aiTask.FlavorName = flaverName
}
}

spec, err := resource.GetCloudbrainSpec(aiTask.ID)
if err == nil {
specJson, _ := json.Marshal(spec)
aiTask.FlavorName = string(specJson)
}
accuracy := make(map[string]string)
accuracy["F1"] = ""
accuracy["Recall"] = ""


Loading…
Cancel
Save