Browse Source

提交代码。

Signed-off-by: zouap <zouap@pcl.ac.cn>
tags/v1.22.7.1
zouap 3 years ago
parent
commit
44e27e1128
2 changed files with 3 additions and 6 deletions
  1. +0
    -4
      routers/api/v1/repo/modelarts.go
  2. +3
    -2
      routers/repo/ai_model_convert.go

+ 0
- 4
routers/api/v1/repo/modelarts.go View File

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


+ 3
- 2
routers/repo/ai_model_convert.go View File

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



Loading…
Cancel
Save