| @@ -151,7 +151,28 @@ func sendNPUInferenceResultToTest(job *models.Cloudbrain) { | |||||
| BDName: datasetnames[0], | BDName: datasetnames[0], | ||||
| } | } | ||||
| jsonContent := "" | jsonContent := "" | ||||
| //TODO | |||||
| VersionOutputPath := modelarts.GetOutputPathByCount(modelarts.TotalVersionCount) | |||||
| resultPath := modelarts.JobPath + job.JobName + modelarts.ResultPath + VersionOutputPath + "/result.json" | |||||
| body, err := storage.ObsDownloadAFile(setting.Bucket, resultPath) | |||||
| if err != nil { | |||||
| log.Info("ObsDownloadAFile error." + err.Error() + " resultPath=" + resultPath) | |||||
| } else { | |||||
| defer body.Close() | |||||
| var data []byte | |||||
| p := make([]byte, 4096) | |||||
| var readErr error | |||||
| var readCount int | |||||
| for { | |||||
| readCount, readErr = body.Read(p) | |||||
| if readCount > 0 { | |||||
| data = append(data, p[:readCount]...) | |||||
| } | |||||
| if readErr != nil || readCount == 0 { | |||||
| break | |||||
| } | |||||
| } | |||||
| jsonContent = string(data) | |||||
| } | |||||
| if jsonContent != "" { | if jsonContent != "" { | ||||
| serialNo, err := aisafety.CreateSafetyTask(req, jsonContent) | serialNo, err := aisafety.CreateSafetyTask(req, jsonContent) | ||||