|
|
@@ -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) |
|
|
|
} |