From 1f88c711bc09d6e22eea6f20b83b328d62b5a564 Mon Sep 17 00:00:00 2001 From: zouap Date: Wed, 12 Oct 2022 16:40:37 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E4=BA=91=E8=84=911=E4=BD=BF?= =?UTF-8?q?=E7=94=A8=E7=9A=84=E4=BB=BB=E5=8A=A1=E8=A7=84=E6=A0=BC=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zouap --- routers/repo/ai_model_manage.go | 1 + routers/repo/aisafety.go | 9 +++++---- templates/repo/modelsafety/new.tmpl | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/routers/repo/ai_model_manage.go b/routers/repo/ai_model_manage.go index 957028fc6..f29cda43b 100644 --- a/routers/repo/ai_model_manage.go +++ b/routers/repo/ai_model_manage.go @@ -85,6 +85,7 @@ func saveModelByParameters(jobId string, versionName string, name string, versio accuracy["Precision"] = "" accuracyJson, _ := json.Marshal(accuracy) log.Info("accuracyJson=" + string(accuracyJson)) + aiTask.ContainerIp = "" aiTaskJson, _ := json.Marshal(aiTask) model := &models.AiModelManage{ diff --git a/routers/repo/aisafety.go b/routers/repo/aisafety.go index de41f05a8..70a4c027e 100644 --- a/routers/repo/aisafety.go +++ b/routers/repo/aisafety.go @@ -428,7 +428,7 @@ func sendGPUInferenceResultToTest(job *models.Cloudbrain) { if jsonContent != "" { sendHttpReqToBeihang(job, jsonContent, req) } else { - updateJobFailed(job) + updateJobFailed(job, "推理生成的Json数据为空,无法进行评测。") } } @@ -464,13 +464,14 @@ func sendNPUInferenceResultToTest(job *models.Cloudbrain) { if jsonContent != "" { sendHttpReqToBeihang(job, jsonContent, req) } else { - updateJobFailed(job) + updateJobFailed(job, "推理生成的Json数据为空,无法进行评测。") } } -func updateJobFailed(job *models.Cloudbrain) { +func updateJobFailed(job *models.Cloudbrain, msg string) { log.Info("The json is null. so set it failed.") //update task failed. job.Status = string(models.ModelArtsTrainJobFailed) + job.ResultJson = msg err := models.UpdateJob(job) if err != nil { log.Error("UpdateJob failed:", err) @@ -858,7 +859,7 @@ func createForGPU(ctx *context.Context, jobName string) { ckptUrl := setting.Attachment.Minio.RealPath + TrainUrl + CkptName log.Info("ckpt url:" + ckptUrl) spec, err := resource.GetAndCheckSpec(ctx.User.ID, specId, models.FindSpecsOptions{ - JobType: models.JobTypeTrain, + JobType: models.JobTypeBenchmark, ComputeResource: models.GPU, Cluster: models.OpenICluster, AiCenterCode: models.AICenterOfCloudBrainOne}) diff --git a/templates/repo/modelsafety/new.tmpl b/templates/repo/modelsafety/new.tmpl index cc3e42ab2..9a7def09c 100644 --- a/templates/repo/modelsafety/new.tmpl +++ b/templates/repo/modelsafety/new.tmpl @@ -361,7 +361,7 @@ }) ;(function() { - var SPECS = {{ .train_specs }} || {{ .Specs }}; + var SPECS = {{ .benchmark_specs }} || {{ .Specs }}; var showPoint = {{ .CloudBrainPaySwitch }}; window.renderSpecsSelect($('#__specs__'), SPECS, showPoint, { gpu_memory: {{$.i18n.Tr "cloudbrain.gpu_memory"}},