| @@ -349,19 +349,29 @@ func DelAiSafetyTask(ctx *context.Context) { | |||||
| } | } | ||||
| func AiSafetyCreateForGetGPU(ctx *context.Context) { | func AiSafetyCreateForGetGPU(ctx *context.Context) { | ||||
| t := time.Now() | |||||
| ctx.Data["PageIsCloudBrain"] = true | ctx.Data["PageIsCloudBrain"] = true | ||||
| ctx.Data["IsCreate"] = true | ctx.Data["IsCreate"] = true | ||||
| ctx.Data["BaseDataSetName"] = setting.ModelSafetyTest.BaseDataSetName | ctx.Data["BaseDataSetName"] = setting.ModelSafetyTest.BaseDataSetName | ||||
| ctx.Data["BaseDataSetUUID"] = setting.ModelSafetyTest.BaseDataSetUUID | ctx.Data["BaseDataSetUUID"] = setting.ModelSafetyTest.BaseDataSetUUID | ||||
| ctx.Data["CombatDataSetName"] = setting.ModelSafetyTest.CombatDataSetName | ctx.Data["CombatDataSetName"] = setting.ModelSafetyTest.CombatDataSetName | ||||
| ctx.Data["CombatDataSetUUID"] = setting.ModelSafetyTest.CombatDataSetUUID | ctx.Data["CombatDataSetUUID"] = setting.ModelSafetyTest.CombatDataSetUUID | ||||
| var displayJobName = jobNamePrefixValid(cutString(ctx.User.Name, 5)) + t.Format("2006010215") + strconv.Itoa(int(t.Unix()))[5:] | |||||
| ctx.Data["display_job_name"] = displayJobName | |||||
| prepareCloudbrainOneSpecs(ctx) | prepareCloudbrainOneSpecs(ctx) | ||||
| queuesDetail, _ := cloudbrain.GetQueuesDetail() | |||||
| if queuesDetail != nil { | |||||
| ctx.Data["QueuesDetail"] = queuesDetail | |||||
| } | |||||
| ctx.HTML(200, tplModelSafetyTestCreateGpu) | ctx.HTML(200, tplModelSafetyTestCreateGpu) | ||||
| } | } | ||||
| func AiSafetyCreateForGetNPU(ctx *context.Context) { | func AiSafetyCreateForGetNPU(ctx *context.Context) { | ||||
| t := time.Now() | |||||
| ctx.Data["PageIsCloudBrain"] = true | ctx.Data["PageIsCloudBrain"] = true | ||||
| ctx.Data["IsCreate"] = true | ctx.Data["IsCreate"] = true | ||||
| var displayJobName = jobNamePrefixValid(cutString(ctx.User.Name, 5)) + t.Format("2006010215") + strconv.Itoa(int(t.Unix()))[5:] | |||||
| ctx.Data["display_job_name"] = displayJobName | |||||
| ctx.Data["BaseDataSetName"] = setting.ModelSafetyTest.BaseDataSetName | ctx.Data["BaseDataSetName"] = setting.ModelSafetyTest.BaseDataSetName | ||||
| ctx.Data["BaseDataSetUUID"] = setting.ModelSafetyTest.BaseDataSetUUID | ctx.Data["BaseDataSetUUID"] = setting.ModelSafetyTest.BaseDataSetUUID | ||||
| ctx.Data["CombatDataSetName"] = setting.ModelSafetyTest.CombatDataSetName | ctx.Data["CombatDataSetName"] = setting.ModelSafetyTest.CombatDataSetName | ||||
| @@ -386,7 +396,8 @@ func AiSafetyCreateForGetNPU(ctx *context.Context) { | |||||
| ctx.Data["engine_versions"] = versionInfos.Version | ctx.Data["engine_versions"] = versionInfos.Version | ||||
| prepareCloudbrainTwoInferenceSpecs(ctx) | prepareCloudbrainTwoInferenceSpecs(ctx) | ||||
| waitCount := cloudbrain.GetWaitingCloudbrainCount(models.TypeCloudBrainTwo, "") | |||||
| ctx.Data["WaitCount"] = waitCount | |||||
| ctx.HTML(200, tplModelSafetyTestCreateNpu) | ctx.HTML(200, tplModelSafetyTestCreateNpu) | ||||
| } | } | ||||