|
|
|
@@ -782,20 +782,22 @@ func QueryModelListForPredict(ctx *context.Context) { |
|
|
|
func QueryModelFileForPredict(ctx *context.Context) { |
|
|
|
id := ctx.Query("ID") |
|
|
|
model, err := models.QueryModelById(id) |
|
|
|
if err != nil { |
|
|
|
if err == nil { |
|
|
|
if model.Type == models.TypeCloudBrainTwo { |
|
|
|
prefix := model.Path[len(setting.Bucket)+1:] |
|
|
|
fileinfos, _ := storage.GetAllObjectByBucketAndPrefix(setting.Bucket, prefix) |
|
|
|
ctx.JSON(http.StatusOK, fileinfos) |
|
|
|
} else if model.Type == models.TypeCloudBrainOne { |
|
|
|
prefix := model.Path[len(setting.Attachment.Minio.Bucket)+1:] |
|
|
|
fileinfos, _ := storage.GetAllObjectByBucketAndPrefixMinio(setting.Attachment.Minio.Bucket, prefix) |
|
|
|
ctx.JSON(http.StatusOK, fileinfos) |
|
|
|
} |
|
|
|
} else { |
|
|
|
log.Error("no such model!", err.Error()) |
|
|
|
ctx.ServerError("no such model:", err) |
|
|
|
return |
|
|
|
} |
|
|
|
if model.Type == models.TypeCloudBrainTwo { |
|
|
|
prefix := model.Path[len(setting.Bucket)+1:] |
|
|
|
fileinfos, _ := storage.GetAllObjectByBucketAndPrefix(setting.Bucket, prefix) |
|
|
|
ctx.JSON(http.StatusOK, fileinfos) |
|
|
|
} else if model.Type == models.TypeCloudBrainOne { |
|
|
|
prefix := model.Path[len(setting.Attachment.Minio.Bucket)+1:] |
|
|
|
fileinfos, _ := storage.GetAllObjectByBucketAndPrefixMinio(setting.Attachment.Minio.Bucket, prefix) |
|
|
|
ctx.JSON(http.StatusOK, fileinfos) |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
func QueryOneLevelModelFile(ctx *context.Context) { |
|
|
|
|