| @@ -611,6 +611,8 @@ func AiSafetyCreateForPost(ctx *context.Context) { | |||||
| taskType := ctx.QueryInt("type") | taskType := ctx.QueryInt("type") | ||||
| description := ctx.Query("description") | description := ctx.Query("description") | ||||
| ctx.Data["type"] = taskType | |||||
| ctx.Data["displayJobName"] = displayJobName | |||||
| ctx.Data["description"] = description | ctx.Data["description"] = description | ||||
| repo := ctx.Repo.Repository | repo := ctx.Repo.Repository | ||||
| @@ -667,8 +669,10 @@ func AiSafetyCreateForPost(ctx *context.Context) { | |||||
| } | } | ||||
| if taskType == models.TypeCloudBrainTwo { | if taskType == models.TypeCloudBrainTwo { | ||||
| ctx.Data["datasetType"] = models.TypeCloudBrainTwo | |||||
| createForNPU(ctx, jobName) | createForNPU(ctx, jobName) | ||||
| } else if taskType == models.TypeCloudBrainOne { | } else if taskType == models.TypeCloudBrainOne { | ||||
| ctx.Data["datasetType"] = models.TypeCloudBrainOne | |||||
| createForGPU(ctx, jobName) | createForGPU(ctx, jobName) | ||||
| } else if taskType == models.TypeC2Net { | } else if taskType == models.TypeC2Net { | ||||
| ComputeResource := ctx.Query("compute_resource") | ComputeResource := ctx.Query("compute_resource") | ||||
| @@ -678,6 +682,7 @@ func AiSafetyCreateForPost(ctx *context.Context) { | |||||
| createForGrampusGPU(ctx, jobName) | createForGrampusGPU(ctx, jobName) | ||||
| } | } | ||||
| } | } | ||||
| log.Info("to redirect...") | |||||
| ctx.Redirect(setting.AppSubURL + ctx.Repo.RepoLink + "/cloudbrain/benchmark") | 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") | specId := ctx.QueryInt64("spec_id") | ||||
| TrainUrl := ctx.Query("train_url") | TrainUrl := ctx.Query("train_url") | ||||
| CkptName := ctx.Query("ckpt_name") | 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 | repo := ctx.Repo.Repository | ||||
| codeLocalPath := setting.JobPath + jobName + cloudbrain.CodeMountPath + "/" | codeLocalPath := setting.JobPath + jobName + cloudbrain.CodeMountPath + "/" | ||||
| codeMinioPath := setting.CBCodePathPrefix + 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["train_url"] = ctx.Query("train_url") | ||||
| ctx.Data["ckpt_name"] = ctx.Query("ckpt_name") | 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) | prepareCloudbrainOneSpecs(ctx) | ||||
| prepareCloudbrainTwoInferenceSpecs(ctx) | |||||
| return nil | return nil | ||||
| } | } | ||||