Browse Source

提交代码。

Signed-off-by: zouap <zouap@pcl.ac.cn>
tags/v1.22.10.1^2
zouap 3 years ago
parent
commit
c6b6b19516
1 changed files with 5 additions and 0 deletions
  1. +5
    -0
      routers/repo/aisafety.go

+ 5
- 0
routers/repo/aisafety.go View File

@@ -307,11 +307,13 @@ func queryTaskStatusFromCloudbrainTwo(job *models.Cloudbrain) {
job.Duration = result.Duration job.Duration = result.Duration
job.TrainJobDuration = result.TrainJobDuration job.TrainJobDuration = result.TrainJobDuration
if job.Status != string(models.ModelArtsTrainJobCompleted) { if job.Status != string(models.ModelArtsTrainJobCompleted) {
log.Info("CloudbrainTwo task status=" + job.Status)
err = models.UpdateJob(job) err = models.UpdateJob(job)
if err != nil { if err != nil {
log.Error("UpdateJob failed:", err) log.Error("UpdateJob failed:", err)
} }
} else { } else {
log.Info("start to deal ModelSafetyTesting, task status=" + job.Status)
job.Status = string(models.ModelSafetyTesting) job.Status = string(models.ModelSafetyTesting)
err = models.UpdateJob(job) err = models.UpdateJob(job)
if err != nil { if err != nil {
@@ -324,6 +326,7 @@ func queryTaskStatusFromCloudbrainTwo(job *models.Cloudbrain) {
} }


func sendNPUInferenceResultToTest(job *models.Cloudbrain) { func sendNPUInferenceResultToTest(job *models.Cloudbrain) {
log.Info("start to sendNPUInferenceResultToTest")
datasetname := job.DatasetName datasetname := job.DatasetName
datasetnames := strings.Split(datasetname, ";") datasetnames := strings.Split(datasetname, ";")
indicator := job.LabelName indicator := job.LabelName
@@ -340,6 +343,8 @@ func sendNPUInferenceResultToTest(job *models.Cloudbrain) {
jsonContent := "" jsonContent := ""
VersionOutputPath := modelarts.GetOutputPathByCount(modelarts.TotalVersionCount) VersionOutputPath := modelarts.GetOutputPathByCount(modelarts.TotalVersionCount)
resultPath := modelarts.JobPath + job.JobName + modelarts.ResultPath + VersionOutputPath + "/result.json" 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) body, err := storage.ObsDownloadAFile(setting.Bucket, resultPath)
if err != nil { if err != nil {
log.Info("ObsDownloadAFile error." + err.Error() + " resultPath=" + resultPath) log.Info("ObsDownloadAFile error." + err.Error() + " resultPath=" + resultPath)


Loading…
Cancel
Save