| @@ -28,7 +28,7 @@ const ( | |||||
| MODEL_NOT_LATEST = 0 | MODEL_NOT_LATEST = 0 | ||||
| ) | ) | ||||
| func saveModelByParameters(jobId string, versionName string, name string, version string, label string, description string, ctx *context.Context) error { | |||||
| func saveModelByParameters(jobId string, versionName string, name string, version string, label string, description string, engine int, ctx *context.Context) error { | |||||
| aiTask, err := models.GetCloudbrainByJobIDAndVersionName(jobId, versionName) | aiTask, err := models.GetCloudbrainByJobIDAndVersionName(jobId, versionName) | ||||
| if err != nil { | if err != nil { | ||||
| aiTask, err = models.GetRepoCloudBrainByJobID(ctx.Repo.Repository.ID, jobId) | aiTask, err = models.GetRepoCloudBrainByJobID(ctx.Repo.Repository.ID, jobId) | ||||
| @@ -153,8 +153,9 @@ func SaveModel(ctx *context.Context) { | |||||
| version := ctx.Query("Version") | version := ctx.Query("Version") | ||||
| label := ctx.Query("Label") | label := ctx.Query("Label") | ||||
| description := ctx.Query("Description") | description := ctx.Query("Description") | ||||
| engine := ctx.QueryInt("Engine") | |||||
| trainTaskCreate := ctx.QueryBool("trainTaskCreate") | trainTaskCreate := ctx.QueryBool("trainTaskCreate") | ||||
| log.Info("engine=" + fmt.Sprint(engine)) | |||||
| if !trainTaskCreate { | if !trainTaskCreate { | ||||
| if !ctx.Repo.CanWrite(models.UnitTypeModelManage) { | if !ctx.Repo.CanWrite(models.UnitTypeModelManage) { | ||||
| //ctx.NotFound(ctx.Req.URL.RequestURI(), nil) | //ctx.NotFound(ctx.Req.URL.RequestURI(), nil) | ||||
| @@ -173,7 +174,7 @@ func SaveModel(ctx *context.Context) { | |||||
| return | return | ||||
| } | } | ||||
| err := saveModelByParameters(JobId, VersionName, name, version, label, description, ctx) | |||||
| err := saveModelByParameters(JobId, VersionName, name, version, label, description, engine, ctx) | |||||
| if err != nil { | if err != nil { | ||||
| log.Info("save model error." + err.Error()) | log.Info("save model error." + err.Error()) | ||||
| @@ -168,7 +168,7 @@ export default { | |||||
| tableData= res.data | tableData= res.data | ||||
| for(let i=0;i<tableData.length;i++){ | for(let i=0;i<tableData.length;i++){ | ||||
| TrainTaskInfo = JSON.parse(tableData[i].TrainTaskInfo) | TrainTaskInfo = JSON.parse(tableData[i].TrainTaskInfo) | ||||
| tableData[i].EngineName = TrainTaskInfo.EngineName.split('-')[0] | |||||
| tableData[i].EngineName = getEngineName(tableData[i]) | |||||
| tableData[i].ComputeResource = TrainTaskInfo.ComputeResource | tableData[i].ComputeResource = TrainTaskInfo.ComputeResource | ||||
| tableData[i].cName=tableData[i].Name | tableData[i].cName=tableData[i].Name | ||||
| tableData[i].Name='' | tableData[i].Name='' | ||||
| @@ -347,6 +347,18 @@ export default { | |||||
| }) | }) | ||||
| .modal('show') | .modal('show') | ||||
| }, | }, | ||||
| getEngineName(model){ | |||||
| if(model.Engine == 0){ | |||||
| return "Pytorch"; | |||||
| }else if(model.Engine == 1 || model.Engine == 121){ | |||||
| return "TensorFlow"; | |||||
| }else if(model.Engine == 2 || model.Engine == 122){ | |||||
| return "MindSpore"; | |||||
| }else{ | |||||
| return "Other" | |||||
| } | |||||
| }, | |||||
| getModelList(){ | getModelList(){ | ||||
| try { | try { | ||||
| this.$refs.table.store.states.lazyTreeNodeMap = {} | this.$refs.table.store.states.lazyTreeNodeMap = {} | ||||
| @@ -360,7 +372,7 @@ export default { | |||||
| for(let i=0;i<this.tableData.length;i++){ | for(let i=0;i<this.tableData.length;i++){ | ||||
| TrainTaskInfo = JSON.parse(this.tableData[i].TrainTaskInfo) | TrainTaskInfo = JSON.parse(this.tableData[i].TrainTaskInfo) | ||||
| this.tableData[i].cName=this.tableData[i].Name | this.tableData[i].cName=this.tableData[i].Name | ||||
| this.tableData[i].EngineName = TrainTaskInfo.EngineName.split('-')[0] | |||||
| this.tableData[i].EngineName = getEngineName(this.tableData[i]) | |||||
| this.tableData[i].ComputeResource = TrainTaskInfo.ComputeResource | this.tableData[i].ComputeResource = TrainTaskInfo.ComputeResource | ||||
| this.tableData[i].hasChildren = res.data.data[i].VersionCount===1 ? false : true | this.tableData[i].hasChildren = res.data.data[i].VersionCount===1 ? false : true | ||||
| } | } | ||||