diff --git a/routers/api/v1/repo/modelarts.go b/routers/api/v1/repo/modelarts.go index 17efa48ea..7f24e6a71 100755 --- a/routers/api/v1/repo/modelarts.go +++ b/routers/api/v1/repo/modelarts.go @@ -7,7 +7,6 @@ package repo import ( "encoding/json" - "fmt" "net/http" "strconv" "strings" @@ -302,9 +301,6 @@ func trainJobForModelConvertGetLogContent(jobID string, baseLine string, order s log.Error("GetTrainJobLogFileNames(%s) failed:%v", task.CloudBrainTaskId, err.Error()) return nil, nil, err } - for i, file := range resultLogFile.LogFileList { - log.Info("i=" + fmt.Sprint(i) + " log file name=" + file) - } result, err := modelarts.GetTrainJobLog(task.CloudBrainTaskId, task.ModelArtsVersionId, baseLine, resultLogFile.LogFileList[0], order, lines) if err != nil { log.Error("GetTrainJobLog(%s) failed:%v", task.CloudBrainTaskId, err.Error()) diff --git a/routers/repo/ai_model_convert.go b/routers/repo/ai_model_convert.go index 71a6075cd..d3414c274 100644 --- a/routers/repo/ai_model_convert.go +++ b/routers/repo/ai_model_convert.go @@ -662,7 +662,8 @@ func ModelConvertDownloadModel(ctx *context.Context) { ctx.ServerError("no file to download.", err) } } else { - Prefix := strings.TrimPrefix(path.Join(setting.TrainJobModelPath, job.ID, "output/", "V0001", ""), "/") + Prefix := path.Join(setting.TrainJobModelPath, job.ID, "output/", "V0001", "") + "/" + log.Info("bucket=" + setting.Bucket + "prefix=" + Prefix) allFile, err := storage.GetAllObjectByBucketAndPrefix(setting.Bucket, Prefix) if err == nil { returnFileName := job.Name + ".zip" @@ -696,7 +697,7 @@ func ModelConvertDownloadModel(ctx *context.Context) { ctx.ServerError("GetObsCreateSignedUrl", err) return } - http.Redirect(ctx.Resp, ctx.Req.Request, url, http.StatusMovedPermanently) + http.Redirect(ctx.Resp, ctx.Req.Request, url, http.StatusTemporaryRedirect) } }