diff --git a/models/cloudbrain.go b/models/cloudbrain.go index a8b707a68..44782ded1 100755 --- a/models/cloudbrain.go +++ b/models/cloudbrain.go @@ -1459,9 +1459,9 @@ func QueryModelTrainJobList(repoId int64) ([]*CloudbrainInfo, int, error) { cond = cond.And( builder.Eq{"job_type": "TRAIN"}, ) - cond = cond.And( - builder.In("type", 0, 1), - ) + // cond = cond.And( + // builder.In("type", 0, 1), + // ) cloudbrains := make([]*CloudbrainInfo, 0) if err := sess.Select("job_id,display_job_name").Table(&Cloudbrain{}).Where(cond).OrderBy("created_unix DESC"). diff --git a/routers/repo/ai_model_manage.go b/routers/repo/ai_model_manage.go index 7452a8a8e..33e086f7f 100644 --- a/routers/repo/ai_model_manage.go +++ b/routers/repo/ai_model_manage.go @@ -81,6 +81,16 @@ func saveModelByParameters(jobId string, versionName string, name string, versio log.Info("download model from CloudBrainOne faild." + err.Error()) return err } + } else if cloudType == models.TypeC2Net { + if aiTask.ComputeResource == models.NPUResource { + modelPath, modelSize, err = downloadModelFromCloudBrainTwo(id, aiTask.JobName, "", aiTask.TrainUrl, modelSelectedFile) + if err != nil { + log.Info("download model from CloudBrainTwo faild." + err.Error()) + return err + } + } else if aiTask.ComputeResource == models.GPUResource { + + } } accuracy := make(map[string]string) accuracy["F1"] = "" diff --git a/templates/repo/modelmanage/index.tmpl b/templates/repo/modelmanage/index.tmpl index 65873d2ed..73211b091 100644 --- a/templates/repo/modelmanage/index.tmpl +++ b/templates/repo/modelmanage/index.tmpl @@ -440,7 +440,15 @@ if(trainJob ==null || trainJob ==""){ console.log("trainJob is null"); }else{ - $.get(`${repolink}/modelmanage/query_train_model?jobName=${trainJob.JobName}&type=${trainJob.Type}&VersionName=${trainJob.VersionName}`, (data) => { + let type = trainJob.Type; + if(type == 3){ + if(trainJob.ComputeResource=="NPU"){ + type=1; + }else{ + type=0; + } + } + $.get(`${repolink}/modelmanage/query_train_model?jobName=${trainJob.JobName}&type=${type}&VersionName=${trainJob.VersionName}`, (data) => { const n_length = data.length let file_html='' let firstFileName =''