Browse Source

提交代码

tags/v1.22.7.1
ychao_1983 3 years ago
parent
commit
e4c9094a6d
2 changed files with 2 additions and 41 deletions
  1. +1
    -40
      routers/repo/cloudbrain.go
  2. +1
    -1
      routers/repo/modelarts.go

+ 1
- 40
routers/repo/cloudbrain.go View File

@@ -99,45 +99,6 @@ func cloudBrainNewDataPrepare(ctx *context.Context) error {
var displayJobName = jobNamePrefixValid(cutString(ctx.User.Name, 5)) + t.Format("2006010215") + strconv.Itoa(int(t.Unix()))[5:]
ctx.Data["display_job_name"] = displayJobName

result, err := cloudbrain.GetImages()
if err != nil {
ctx.Data["error"] = err.Error()
log.Error("cloudbrain.GetImages failed:", err.Error(), ctx.Data["MsgID"])
}

for i, payload := range result.Payload.ImageInfo {
if strings.HasPrefix(result.Payload.ImageInfo[i].Place, "192.168") {
result.Payload.ImageInfo[i].PlaceView = payload.Place[strings.Index(payload.Place, "/"):len(payload.Place)]
} else {
result.Payload.ImageInfo[i].PlaceView = payload.Place
}
}

ctx.Data["images"] = result.Payload.ImageInfo

resultPublic, err := cloudbrain.GetPublicImages()
if err != nil {
ctx.Data["error"] = err.Error()
log.Error("cloudbrain.GetPublicImages failed:", err.Error(), ctx.Data["MsgID"])
}

for i, payload := range resultPublic.Payload.ImageInfo {
if strings.HasPrefix(resultPublic.Payload.ImageInfo[i].Place, "192.168") {
resultPublic.Payload.ImageInfo[i].PlaceView = payload.Place[strings.Index(payload.Place, "/"):len(payload.Place)]
} else {
resultPublic.Payload.ImageInfo[i].PlaceView = payload.Place
}
}

ctx.Data["public_images"] = resultPublic.Payload.ImageInfo

attachs, err := models.GetAllUserAttachments(ctx.User.ID)
if err != nil {
log.Error("GetAllUserAttachments failed: %v", err, ctx.Data["MsgID"])
return err
}

ctx.Data["attachments"] = attachs
ctx.Data["command"] = cloudbrain.Command
ctx.Data["code_path"] = cloudbrain.CodeMountPath
ctx.Data["dataset_path"] = cloudbrain.DataSetMountPath
@@ -353,7 +314,7 @@ func CloudBrainInferenceJobCreate(ctx *context.Context, form auth.CreateCloudBra
branchName := form.BranchName
repo := ctx.Repo.Repository

ckptUrl := setting.Attachment.Minio.RealPath + setting.Attachment.Minio.Bucket + "/" + form.TrainUrl + form.CkptName
ckptUrl := setting.Attachment.Minio.RealPath + "/" + form.TrainUrl + form.CkptName
log.Info("ckpt url:" + ckptUrl)
tpl := tplCloudBrainInferenceJobNew
command, err := getInferenceJobCommand(form)


+ 1
- 1
routers/repo/modelarts.go View File

@@ -1881,7 +1881,7 @@ func InferenceJobCreate(ctx *context.Context, form auth.CreateModelArtsInference
modelName := form.ModelName
modelVersion := form.ModelVersion
ckptName := form.CkptName
ckptUrl := "/" + setting.Bucket + "/" + form.TrainUrl + form.CkptName
ckptUrl := "/" + form.TrainUrl + form.CkptName
log.Info("ckpt url:" + ckptUrl)

count, err := models.GetCloudbrainInferenceJobCountByUserID(ctx.User.ID)


Loading…
Cancel
Save