diff --git a/routers/repo/cloudbrain.go b/routers/repo/cloudbrain.go index 457f275ed..c1e89dde5 100755 --- a/routers/repo/cloudbrain.go +++ b/routers/repo/cloudbrain.go @@ -2718,7 +2718,7 @@ func getTrainJobCommand(form auth.CreateCloudBrainForm) (string, error) { } } - command += "python /code/" + bootFile + param + " > " + cloudbrain.ModelMountPath + "/" + form.DisplayJobName + "-" + cloudbrain.LogFile + command += "python /code/" + bootFile + param + " | tee " + cloudbrain.ModelMountPath + "/" + form.DisplayJobName + "-" + cloudbrain.LogFile return command, nil } diff --git a/routers/repo/modelarts.go b/routers/repo/modelarts.go index 25c394efc..40e8076fb 100755 --- a/routers/repo/modelarts.go +++ b/routers/repo/modelarts.go @@ -2066,13 +2066,6 @@ func InferenceJobCreate(ctx *context.Context, form auth.CreateModelArtsInference gitRepo, _ := git.OpenRepository(repo.RepoPath()) commitID, _ := gitRepo.GetBranchCommitID(branchName) - _, dataUrl, datasetNames, _, err := getDatasUrlListByUUIDS(uuid) - if err != nil { - inferenceJobErrorNewDataPrepare(ctx, form) - ctx.RenderWithErr(ctx.Tr(errStr), tplModelArtsInferenceJobNew, &form) - return - } - if err := downloadCode(repo, codeLocalPath, branchName); err != nil { log.Error("Create task failed, server timed out: %s (%v)", repo.FullName(), err) inferenceJobErrorNewDataPrepare(ctx, form) @@ -2111,6 +2104,28 @@ func InferenceJobCreate(ctx *context.Context, form auth.CreateModelArtsInference Label: modelarts.CkptUrl, Value: "s3:/" + ckptUrl, }) + + datasUrlList, dataUrl, datasetNames, isMultiDataset, err := getDatasUrlListByUUIDS(uuid) + if err != nil { + inferenceJobErrorNewDataPrepare(ctx, form) + ctx.RenderWithErr(ctx.Tr(errStr), tplModelArtsInferenceJobNew, &form) + return + } + dataPath := dataUrl + jsondatas, err := json.Marshal(datasUrlList) + if err != nil { + log.Error("Failed to Marshal: %v", err) + inferenceJobErrorNewDataPrepare(ctx, form) + ctx.RenderWithErr("json error:"+err.Error(), tplModelArtsInferenceJobNew, &form) + return + } + if isMultiDataset { + param = append(param, models.Parameter{ + Label: modelarts.MultiDataUrl, + Value: string(jsondatas), + }) + } + existDeviceTarget := false if len(params) != 0 { err := json.Unmarshal([]byte(params), ¶meters) @@ -2143,7 +2158,7 @@ func InferenceJobCreate(ctx *context.Context, form auth.CreateModelArtsInference req := &modelarts.GenerateInferenceJobReq{ JobName: jobName, DisplayJobName: displayJobName, - DataUrl: dataUrl, + DataUrl: dataPath, Description: description, CodeObsPath: codeObsPath, BootFileUrl: codeObsPath + bootFile,