|
|
|
@@ -307,11 +307,13 @@ func queryTaskStatusFromCloudbrainTwo(job *models.Cloudbrain) { |
|
|
|
job.Duration = result.Duration |
|
|
|
job.TrainJobDuration = result.TrainJobDuration |
|
|
|
if job.Status != string(models.ModelArtsTrainJobCompleted) { |
|
|
|
log.Info("CloudbrainTwo task status=" + job.Status) |
|
|
|
err = models.UpdateJob(job) |
|
|
|
if err != nil { |
|
|
|
log.Error("UpdateJob failed:", err) |
|
|
|
} |
|
|
|
} else { |
|
|
|
log.Info("start to deal ModelSafetyTesting, task status=" + job.Status) |
|
|
|
job.Status = string(models.ModelSafetyTesting) |
|
|
|
err = models.UpdateJob(job) |
|
|
|
if err != nil { |
|
|
|
@@ -324,6 +326,7 @@ func queryTaskStatusFromCloudbrainTwo(job *models.Cloudbrain) { |
|
|
|
} |
|
|
|
|
|
|
|
func sendNPUInferenceResultToTest(job *models.Cloudbrain) { |
|
|
|
log.Info("start to sendNPUInferenceResultToTest") |
|
|
|
datasetname := job.DatasetName |
|
|
|
datasetnames := strings.Split(datasetname, ";") |
|
|
|
indicator := job.LabelName |
|
|
|
@@ -340,6 +343,8 @@ func sendNPUInferenceResultToTest(job *models.Cloudbrain) { |
|
|
|
jsonContent := "" |
|
|
|
VersionOutputPath := modelarts.GetOutputPathByCount(modelarts.TotalVersionCount) |
|
|
|
resultPath := modelarts.JobPath + job.JobName + modelarts.ResultPath + VersionOutputPath + "/result.json" |
|
|
|
resultPath = resultPath[1:] |
|
|
|
log.Info("bucket=" + setting.Bucket + " resultPath=" + resultPath) |
|
|
|
body, err := storage.ObsDownloadAFile(setting.Bucket, resultPath) |
|
|
|
if err != nil { |
|
|
|
log.Info("ObsDownloadAFile error." + err.Error() + " resultPath=" + resultPath) |
|
|
|
|