Browse Source

提交代码。

Signed-off-by: zouap <zouap@pcl.ac.cn>
tags/v1.22.1.1^2
zouap 3 years ago
parent
commit
373e08cacf
1 changed files with 4 additions and 0 deletions
  1. +4
    -0
      routers/repo/ai_model_manage.go

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

@@ -626,6 +626,7 @@ func QueryModelListForPredict(ctx *context.Context) {

func QueryModelFileForPredict(ctx *context.Context) {
id := ctx.Query("ID")
parentDir := ctx.Query("parentDir")
model, err := models.QueryModelById(id)
if err != nil {
log.Error("no such model!", err.Error())
@@ -633,6 +634,9 @@ func QueryModelFileForPredict(ctx *context.Context) {
return
}
prefix := model.Path[len(setting.Bucket)+1:]
if parentDir != "" {
prefix = prefix + parentDir
}
fileinfos, err := storage.GetAllObjectByBucketAndPrefix(setting.Bucket, prefix)
ctx.JSON(http.StatusOK, fileinfos)
}

Loading…
Cancel
Save