| @@ -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) { | 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"]) | log.Error("the job(%s) has not been stopped", task.JobName, ctx.Data["msgID"]) | ||||
| result["msg"] = "the job(" + task.JobName + ") has not been stopped" | 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 | return | ||||
| } | } | ||||
| if task.Type == models.TypeCloudBrainOne { | if task.Type == models.TypeCloudBrainOne { | ||||
| @@ -206,9 +206,7 @@ func DelAiSafetyTask(ctx *context.Context) { | |||||
| ctx.JSON(200, result) | ctx.JSON(200, result) | ||||
| return | 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) { | func syncAiSafetyTaskStatus(job *models.Cloudbrain) { | ||||
| @@ -330,15 +328,18 @@ func sendNPUInferenceResultToTest(job *models.Cloudbrain) { | |||||
| datasetname := job.DatasetName | datasetname := job.DatasetName | ||||
| datasetnames := strings.Split(datasetname, ";") | datasetnames := strings.Split(datasetname, ";") | ||||
| indicator := job.LabelName | indicator := job.LabelName | ||||
| EvalContent := "test1" | |||||
| if job.Description != "" { | |||||
| EvalContent = job.Description | |||||
| } | |||||
| req := aisafety.TaskReq{ | req := aisafety.TaskReq{ | ||||
| UnionId: job.JobID, | UnionId: job.JobID, | ||||
| EvalName: job.DisplayJobName, | EvalName: job.DisplayJobName, | ||||
| EvalContent: job.Description, | |||||
| EvalContent: EvalContent, | |||||
| TLPath: "test", | TLPath: "test", | ||||
| Indicators: strings.Split(indicator, ";"), | 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 := "" | jsonContent := "" | ||||
| VersionOutputPath := modelarts.GetOutputPathByCount(modelarts.TotalVersionCount) | VersionOutputPath := modelarts.GetOutputPathByCount(modelarts.TotalVersionCount) | ||||