From 1b4b30c80c578071da2192d5b0752317b87678b5 Mon Sep 17 00:00:00 2001 From: zouap Date: Fri, 26 Aug 2022 09:47:13 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=97=A5=E5=BF=97=E9=87=8D=E5=AE=9A?= =?UTF-8?q?=E5=90=91=E7=A0=94=E7=A9=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zouap --- routers/repo/cloudbrain.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 } From af6c0020b11bd874d67d0d5745ba90633b9574df Mon Sep 17 00:00:00 2001 From: zouap Date: Fri, 26 Aug 2022 10:33:04 +0800 Subject: [PATCH 2/2] =?UTF-8?q?NPU=E6=8E=A8=E7=90=86=E6=94=AF=E6=8C=81?= =?UTF-8?q?=E5=A4=9A=E6=95=B0=E6=8D=AE=E9=9B=86=E4=BF=AE=E6=94=B9=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zouap --- routers/repo/modelarts.go | 31 +++++++++++++++++++++++-------- 1 file changed, 23 insertions(+), 8 deletions(-) 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,