|
|
@@ -261,7 +261,7 @@ func CloudBrainCreate(ctx *context.Context, form auth.CreateCloudBrainForm) { |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
datasetInfos, datasetNames, fileNames, err := models.GetDatasetInfo(uuids) |
|
|
|
|
|
|
|
|
datasetInfos, datasetNames, err := models.GetDatasetInfo(uuids) |
|
|
if err != nil { |
|
|
if err != nil { |
|
|
log.Error("GetDatasetInfo failed: %v", err, ctx.Data["MsgID"]) |
|
|
log.Error("GetDatasetInfo failed: %v", err, ctx.Data["MsgID"]) |
|
|
cloudBrainNewDataPrepare(ctx) |
|
|
cloudBrainNewDataPrepare(ctx) |
|
|
@@ -272,7 +272,7 @@ func CloudBrainCreate(ctx *context.Context, form auth.CreateCloudBrainForm) { |
|
|
command := cloudbrain.Command |
|
|
command := cloudbrain.Command |
|
|
if jobType == string(models.JobTypeTrain) { |
|
|
if jobType == string(models.JobTypeTrain) { |
|
|
tpl = tplCloudBrainTrainJobNew |
|
|
tpl = tplCloudBrainTrainJobNew |
|
|
commandTrain, err := getTrainJobCommand(form, fileNames) |
|
|
|
|
|
|
|
|
commandTrain, err := getTrainJobCommand(form) |
|
|
if err != nil { |
|
|
if err != nil { |
|
|
log.Error("getTrainJobCommand failed: %v", err) |
|
|
log.Error("getTrainJobCommand failed: %v", err) |
|
|
ctx.RenderWithErr(err.Error(), tpl, &form) |
|
|
ctx.RenderWithErr(err.Error(), tpl, &form) |
|
|
@@ -2036,7 +2036,7 @@ func BenchMarkAlgorithmCreate(ctx *context.Context, form auth.CreateCloudBrainFo |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
uuid := childInfo.Attachment |
|
|
uuid := childInfo.Attachment |
|
|
datasetInfos, datasetNames, _, err := models.GetDatasetInfo(uuid) |
|
|
|
|
|
|
|
|
datasetInfos, datasetNames, err := models.GetDatasetInfo(uuid) |
|
|
if err != nil { |
|
|
if err != nil { |
|
|
log.Error("GetDatasetInfo failed: %v", err, ctx.Data["MsgID"]) |
|
|
log.Error("GetDatasetInfo failed: %v", err, ctx.Data["MsgID"]) |
|
|
cloudBrainNewDataPrepare(ctx) |
|
|
cloudBrainNewDataPrepare(ctx) |
|
|
@@ -2164,7 +2164,7 @@ func ModelBenchmarkCreate(ctx *context.Context, form auth.CreateCloudBrainForm) |
|
|
command = fmt.Sprintf(cloudbrain.BrainScoreCommand, getBrainRegion(benchmarkChildTypeID), displayJobName, trimSpaceNewlineInString(form.Description)) |
|
|
command = fmt.Sprintf(cloudbrain.BrainScoreCommand, getBrainRegion(benchmarkChildTypeID), displayJobName, trimSpaceNewlineInString(form.Description)) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
datasetInfos, datasetNames, _, err := models.GetDatasetInfo(uuid) |
|
|
|
|
|
|
|
|
datasetInfos, datasetNames, err := models.GetDatasetInfo(uuid) |
|
|
if err != nil { |
|
|
if err != nil { |
|
|
log.Error("GetDatasetInfo failed: %v", err, ctx.Data["MsgID"]) |
|
|
log.Error("GetDatasetInfo failed: %v", err, ctx.Data["MsgID"]) |
|
|
cloudBrainNewDataPrepare(ctx) |
|
|
cloudBrainNewDataPrepare(ctx) |
|
|
@@ -2246,7 +2246,7 @@ func CloudBrainTrainJobNew(ctx *context.Context) { |
|
|
ctx.HTML(http.StatusOK, tplCloudBrainTrainJobNew) |
|
|
ctx.HTML(http.StatusOK, tplCloudBrainTrainJobNew) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
func getTrainJobCommand(form auth.CreateCloudBrainForm, fileNames string) (string, error) { |
|
|
|
|
|
|
|
|
func getTrainJobCommand(form auth.CreateCloudBrainForm) (string, error) { |
|
|
var command string |
|
|
var command string |
|
|
bootFile := strings.TrimSpace(form.BootFile) |
|
|
bootFile := strings.TrimSpace(form.BootFile) |
|
|
params := form.Params |
|
|
params := form.Params |
|
|
@@ -2270,8 +2270,6 @@ func getTrainJobCommand(form auth.CreateCloudBrainForm, fileNames string) (strin |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
param += " --dataset_list='" + fileNames + "'" |
|
|
|
|
|
|
|
|
|
|
|
command += "python /code/" + bootFile + param + " > " + cloudbrain.ModelMountPath + "/" + form.DisplayJobName + "-" + cloudbrain.LogFile |
|
|
command += "python /code/" + bootFile + param + " > " + cloudbrain.ModelMountPath + "/" + form.DisplayJobName + "-" + cloudbrain.LogFile |
|
|
|
|
|
|
|
|
return command, nil |
|
|
return command, nil |
|
|
|