From 44e27e1128fe014e7687f89d65e6de98822a5423 Mon Sep 17 00:00:00 2001 From: zouap Date: Thu, 7 Jul 2022 14:19:05 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zouap --- routers/api/v1/repo/modelarts.go | 4 ---- routers/repo/ai_model_convert.go | 5 +++-- 2 files changed, 3 insertions(+), 6 deletions(-) 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) } }