Browse Source

提交代码。

Signed-off-by: zouap <zouap@pcl.ac.cn>
tags/v1.21.12.1^2
zouap 3 years ago
parent
commit
7f46a80597
2 changed files with 6 additions and 26 deletions
  1. +1
    -0
      options/locale/locale_zh-CN.ini
  2. +5
    -26
      routers/repo/ai_model_manage.go

+ 1
- 0
options/locale/locale_zh-CN.ini View File

@@ -894,6 +894,7 @@ modelarts.train_job_para_admin=任务参数管理
modelarts.train_job_para.edit=编辑
modelarts.train_job_para.connfirm=确定

model.manage.create_error=相同的名称和版本的模型已经存在。

template.items=模板选项
template.git_content=Git数据(默认分支)


+ 5
- 26
routers/repo/ai_model_manage.go View File

@@ -358,33 +358,12 @@ func ShowModelInfo(ctx *context.Context) {
}

func ShowSingleModel(ctx *context.Context) {
id := ctx.Query("ID")
parentDir := ctx.Query("parentDir")
log.Info("Show single ModelInfo start.id=" + id)
task, err := models.QueryModelById(id)
if err != nil {
log.Error("no such model!", err.Error())
ctx.ServerError("no such model:", err)
return
}
log.Info("bucket=" + setting.Bucket + " key=" + task.Path[len(setting.Bucket)+1:])
models, err := storage.GetOneLevelAllObjectUnderDir(setting.Bucket, task.Path[len(setting.Bucket)+1:], parentDir)
if err != nil {
log.Info("get model list failed:", err)
ctx.ServerError("GetObsListObject:", err)
return
} else {
log.Info("get model file,size=" + fmt.Sprint(len(models)))
}
name := ctx.Query("name")

if err != nil {
ctx.ServerError("QueryTrainJobList:", err)
} else {
mapInterface := make(map[string]interface{})
mapInterface["task"] = task
mapInterface["models"] = models
ctx.JSON(http.StatusOK, mapInterface)
}
log.Info("Show single ModelInfo start.name=" + name)
models := models.QueryModelByName(name, ctx.Repo.Repository.ID)

ctx.JSON(http.StatusOK, models)
}

func ShowOneVersionOtherModel(ctx *context.Context) {


Loading…
Cancel
Save