From fcad6452b8dd2e6a03c4870ff9ac0fefbe61bd2f Mon Sep 17 00:00:00 2001 From: zouap Date: Mon, 10 Oct 2022 09:08:49 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zouap --- routers/repo/aisafety.go | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/routers/repo/aisafety.go b/routers/repo/aisafety.go index 076de48db..60af18eed 100644 --- a/routers/repo/aisafety.go +++ b/routers/repo/aisafety.go @@ -611,6 +611,8 @@ func AiSafetyCreateForPost(ctx *context.Context) { taskType := ctx.QueryInt("type") description := ctx.Query("description") + ctx.Data["type"] = taskType + ctx.Data["displayJobName"] = displayJobName ctx.Data["description"] = description repo := ctx.Repo.Repository @@ -667,8 +669,10 @@ func AiSafetyCreateForPost(ctx *context.Context) { } if taskType == models.TypeCloudBrainTwo { + ctx.Data["datasetType"] = models.TypeCloudBrainTwo createForNPU(ctx, jobName) } else if taskType == models.TypeCloudBrainOne { + ctx.Data["datasetType"] = models.TypeCloudBrainOne createForGPU(ctx, jobName) } else if taskType == models.TypeC2Net { ComputeResource := ctx.Query("compute_resource") @@ -678,6 +682,7 @@ func AiSafetyCreateForPost(ctx *context.Context) { createForGrampusGPU(ctx, jobName) } } + log.Info("to redirect...") ctx.Redirect(setting.AppSubURL + ctx.Repo.RepoLink + "/cloudbrain/benchmark") } @@ -693,8 +698,8 @@ func createForGrampusGPU(ctx *context.Context, jobName string) { specId := ctx.QueryInt64("spec_id") TrainUrl := ctx.Query("train_url") CkptName := ctx.Query("ckpt_name") - ModelName := ctx.Query("ModelName") - ModelVersion := ctx.Query("ModelVersion") + ModelName := ctx.Query("model_name") + ModelVersion := ctx.Query("model_version") repo := ctx.Repo.Repository codeLocalPath := setting.JobPath + jobName + cloudbrain.CodeMountPath + "/" codeMinioPath := setting.CBCodePathPrefix + jobName + cloudbrain.CodeMountPath + "/" @@ -1163,8 +1168,20 @@ func modelSafetyNewDataPrepare(ctx *context.Context) error { ctx.Data["train_url"] = ctx.Query("train_url") ctx.Data["ckpt_name"] = ctx.Query("ckpt_name") + ctx.Data["train_url"] = ctx.Query("train_url") + ctx.Data["ckpt_name"] = ctx.Query("ckpt_name") + ctx.Data["model_name"] = ctx.Query("model_name") + ctx.Data["model_version"] = ctx.Query("model_version") + + ctx.Data["BaseDataSetName"] = setting.ModelSafetyTest.BaseDataSetName + ctx.Data["BaseDataSetUUID"] = setting.ModelSafetyTest.BaseDataSetUUID + ctx.Data["CombatDataSetName"] = setting.ModelSafetyTest.CombatDataSetName + ctx.Data["CombatDataSetUUID"] = setting.ModelSafetyTest.CombatDataSetUUID + prepareCloudbrainOneSpecs(ctx) + prepareCloudbrainTwoInferenceSpecs(ctx) + return nil }