diff --git a/routers/repo/aisafety.go b/routers/repo/aisafety.go index 52002de6c..9323a80bc 100644 --- a/routers/repo/aisafety.go +++ b/routers/repo/aisafety.go @@ -194,7 +194,7 @@ func DelAiSafetyTask(ctx *context.Context) { if task.Status != string(models.JobStopped) && task.Status != string(models.JobFailed) && task.Status != string(models.JobSucceeded) { log.Error("the job(%s) has not been stopped", task.JobName, ctx.Data["msgID"]) result["msg"] = "the job(" + task.JobName + ") has not been stopped" - ctx.JSON(200, result) + ctx.ServerError("the job("+task.JobName+") has not been stopped", nil) return } if task.Type == models.TypeCloudBrainOne { @@ -206,9 +206,7 @@ func DelAiSafetyTask(ctx *context.Context) { ctx.JSON(200, result) return } - result["code"] = 0 - result["msg"] = "Succeed" - ctx.JSON(200, result) + ctx.Redirect(setting.AppSubURL + ctx.Repo.RepoLink + "/cloudbrain/benchmark") } func syncAiSafetyTaskStatus(job *models.Cloudbrain) { @@ -330,15 +328,18 @@ func sendNPUInferenceResultToTest(job *models.Cloudbrain) { datasetname := job.DatasetName datasetnames := strings.Split(datasetname, ";") indicator := job.LabelName - + EvalContent := "test1" + if job.Description != "" { + EvalContent = job.Description + } req := aisafety.TaskReq{ UnionId: job.JobID, EvalName: job.DisplayJobName, - EvalContent: job.Description, + EvalContent: EvalContent, TLPath: "test", Indicators: strings.Split(indicator, ";"), - CDName: datasetnames[1], - BDName: datasetnames[0], + CDName: datasetnames[1][0 : len(datasetnames[1])-4], + BDName: datasetnames[0][0 : len(datasetnames[1])-4], } jsonContent := "" VersionOutputPath := modelarts.GetOutputPathByCount(modelarts.TotalVersionCount)