Browse Source

调整云脑1使用的任务规格。

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

+ 1
- 0
routers/repo/ai_model_manage.go View File

@@ -85,6 +85,7 @@ func saveModelByParameters(jobId string, versionName string, name string, versio
accuracy["Precision"] = ""
accuracyJson, _ := json.Marshal(accuracy)
log.Info("accuracyJson=" + string(accuracyJson))
aiTask.ContainerIp = ""
aiTaskJson, _ := json.Marshal(aiTask)

model := &models.AiModelManage{


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

@@ -428,7 +428,7 @@ func sendGPUInferenceResultToTest(job *models.Cloudbrain) {
if jsonContent != "" {
sendHttpReqToBeihang(job, jsonContent, req)
} else {
updateJobFailed(job)
updateJobFailed(job, "推理生成的Json数据为空,无法进行评测。")
}
}

@@ -464,13 +464,14 @@ func sendNPUInferenceResultToTest(job *models.Cloudbrain) {
if jsonContent != "" {
sendHttpReqToBeihang(job, jsonContent, req)
} else {
updateJobFailed(job)
updateJobFailed(job, "推理生成的Json数据为空,无法进行评测。")
}
}
func updateJobFailed(job *models.Cloudbrain) {
func updateJobFailed(job *models.Cloudbrain, msg string) {
log.Info("The json is null. so set it failed.")
//update task failed.
job.Status = string(models.ModelArtsTrainJobFailed)
job.ResultJson = msg
err := models.UpdateJob(job)
if err != nil {
log.Error("UpdateJob failed:", err)
@@ -858,7 +859,7 @@ func createForGPU(ctx *context.Context, jobName string) {
ckptUrl := setting.Attachment.Minio.RealPath + TrainUrl + CkptName
log.Info("ckpt url:" + ckptUrl)
spec, err := resource.GetAndCheckSpec(ctx.User.ID, specId, models.FindSpecsOptions{
JobType: models.JobTypeTrain,
JobType: models.JobTypeBenchmark,
ComputeResource: models.GPU,
Cluster: models.OpenICluster,
AiCenterCode: models.AICenterOfCloudBrainOne})


+ 1
- 1
templates/repo/modelsafety/new.tmpl View File

@@ -361,7 +361,7 @@
})

;(function() {
var SPECS = {{ .train_specs }} || {{ .Specs }};
var SPECS = {{ .benchmark_specs }} || {{ .Specs }};
var showPoint = {{ .CloudBrainPaySwitch }};
window.renderSpecsSelect($('#__specs__'), SPECS, showPoint, {
gpu_memory: {{$.i18n.Tr "cloudbrain.gpu_memory"}},


Loading…
Cancel
Save