From e501169c789411b0986543ceaaaaf4ed28ad9b46 Mon Sep 17 00:00:00 2001 From: ychao_1983 Date: Fri, 8 Jul 2022 17:07:52 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/cloudbrain/cloudbrain.go | 19 ------------------- routers/repo/cloudbrain.go | 4 +++- 2 files changed, 3 insertions(+), 20 deletions(-) diff --git a/modules/cloudbrain/cloudbrain.go b/modules/cloudbrain/cloudbrain.go index 3805f253f..2ce2cf885 100755 --- a/modules/cloudbrain/cloudbrain.go +++ b/modules/cloudbrain/cloudbrain.go @@ -286,25 +286,6 @@ func GenerateTask(req GenerateCloudBrainTaskReq) error { }, }, } - if len(req.CkptName) == 0 { - volumes = append(volumes, models.Volume{ - HostPath: models.StHostPath{ - Path: req.ModelPath, - MountPath: ModelMountPath, - ReadOnly: false, - }, - }) - - } else { - volumes = append(volumes, models.Volume{ - HostPath: models.StHostPath{ - Path: req.ModelPath, - MountPath: ModelMountPath + "/" + req.CkptName, - ReadOnly: false, - }, - }) - - } if len(req.DatasetInfos) == 1 { volumes = append(volumes, models.Volume{ diff --git a/routers/repo/cloudbrain.go b/routers/repo/cloudbrain.go index d7796c0ba..335befcfa 100755 --- a/routers/repo/cloudbrain.go +++ b/routers/repo/cloudbrain.go @@ -429,7 +429,7 @@ func CloudBrainInferenceJobCreate(ctx *context.Context, form auth.CreateCloudBra DatasetNames: datasetNames, DatasetInfos: datasetInfos, CodePath: storage.GetMinioPath(jobName, cloudbrain.CodeMountPath+"/"), - ModelPath: ckptUrl, + ModelPath: setting.Attachment.Minio.RealPath + setting.Attachment.Minio.Bucket + "/" + form.TrainUrl, BenchmarkPath: storage.GetMinioPath(jobName, cloudbrain.BenchMarkMountPath+"/"), Snn4ImageNetPath: storage.GetMinioPath(jobName, cloudbrain.Snn4imagenetMountPath+"/"), BrainScorePath: storage.GetMinioPath(jobName, cloudbrain.BrainScoreMountPath+"/"), @@ -2516,6 +2516,8 @@ func getInferenceJobCommand(form auth.CreateCloudBrainInferencForm) (string, err } } + param += " --modelname" + "=" + form.CkptName + command += "python /code/" + bootFile + param + " > " + cloudbrain.ResultPath + "/" + form.DisplayJobName + "-" + cloudbrain.LogFile return command, nil