Browse Source

提交代码。

Signed-off-by: zouap <zouap@pcl.ac.cn>
tags/v1.22.7.1
zouap 3 years ago
parent
commit
5dcd9d5895
3 changed files with 22 additions and 4 deletions
  1. +3
    -3
      models/cloudbrain.go
  2. +10
    -0
      routers/repo/ai_model_manage.go
  3. +9
    -1
      templates/repo/modelmanage/index.tmpl

+ 3
- 3
models/cloudbrain.go View File

@@ -1459,9 +1459,9 @@ func QueryModelTrainJobList(repoId int64) ([]*CloudbrainInfo, int, error) {
cond = cond.And( cond = cond.And(
builder.Eq{"job_type": "TRAIN"}, 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) cloudbrains := make([]*CloudbrainInfo, 0)
if err := sess.Select("job_id,display_job_name").Table(&Cloudbrain{}).Where(cond).OrderBy("created_unix DESC"). if err := sess.Select("job_id,display_job_name").Table(&Cloudbrain{}).Where(cond).OrderBy("created_unix DESC").


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

@@ -81,6 +81,16 @@ func saveModelByParameters(jobId string, versionName string, name string, versio
log.Info("download model from CloudBrainOne faild." + err.Error()) log.Info("download model from CloudBrainOne faild." + err.Error())
return err 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 := make(map[string]string)
accuracy["F1"] = "" accuracy["F1"] = ""


+ 9
- 1
templates/repo/modelmanage/index.tmpl View File

@@ -440,7 +440,15 @@
if(trainJob ==null || trainJob ==""){ if(trainJob ==null || trainJob ==""){
console.log("trainJob is null"); console.log("trainJob is null");
}else{ }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 const n_length = data.length
let file_html='' let file_html=''
let firstFileName ='' let firstFileName =''


Loading…
Cancel
Save