| @@ -7,7 +7,6 @@ package repo | |||||
| import ( | import ( | ||||
| "encoding/json" | "encoding/json" | ||||
| "fmt" | |||||
| "net/http" | "net/http" | ||||
| "strconv" | "strconv" | ||||
| "strings" | "strings" | ||||
| @@ -302,9 +301,6 @@ func trainJobForModelConvertGetLogContent(jobID string, baseLine string, order s | |||||
| log.Error("GetTrainJobLogFileNames(%s) failed:%v", task.CloudBrainTaskId, err.Error()) | log.Error("GetTrainJobLogFileNames(%s) failed:%v", task.CloudBrainTaskId, err.Error()) | ||||
| return nil, nil, err | 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) | result, err := modelarts.GetTrainJobLog(task.CloudBrainTaskId, task.ModelArtsVersionId, baseLine, resultLogFile.LogFileList[0], order, lines) | ||||
| if err != nil { | if err != nil { | ||||
| log.Error("GetTrainJobLog(%s) failed:%v", task.CloudBrainTaskId, err.Error()) | log.Error("GetTrainJobLog(%s) failed:%v", task.CloudBrainTaskId, err.Error()) | ||||
| @@ -662,7 +662,8 @@ func ModelConvertDownloadModel(ctx *context.Context) { | |||||
| ctx.ServerError("no file to download.", err) | ctx.ServerError("no file to download.", err) | ||||
| } | } | ||||
| } else { | } 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) | allFile, err := storage.GetAllObjectByBucketAndPrefix(setting.Bucket, Prefix) | ||||
| if err == nil { | if err == nil { | ||||
| returnFileName := job.Name + ".zip" | returnFileName := job.Name + ".zip" | ||||
| @@ -696,7 +697,7 @@ func ModelConvertDownloadModel(ctx *context.Context) { | |||||
| ctx.ServerError("GetObsCreateSignedUrl", err) | ctx.ServerError("GetObsCreateSignedUrl", err) | ||||
| return | return | ||||
| } | } | ||||
| http.Redirect(ctx.Resp, ctx.Req.Request, url, http.StatusMovedPermanently) | |||||
| http.Redirect(ctx.Resp, ctx.Req.Request, url, http.StatusTemporaryRedirect) | |||||
| } | } | ||||
| } | } | ||||