Browse Source

提交代码。

Signed-off-by: zouap <zouap@pcl.ac.cn>
tags/v1.22.10.1^2
zouap 3 years ago
parent
commit
fcad6452b8
1 changed files with 19 additions and 2 deletions
  1. +19
    -2
      routers/repo/aisafety.go

+ 19
- 2
routers/repo/aisafety.go View File

@@ -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
}



Loading…
Cancel
Save