diff --git a/routers/repo/aisafety.go b/routers/repo/aisafety.go index dde89dfab..1320ad0db 100644 --- a/routers/repo/aisafety.go +++ b/routers/repo/aisafety.go @@ -977,6 +977,7 @@ func modelSafetyNewDataPrepare(ctx *context.Context) error { ctx.Data["BaseDataSetUUID"] = setting.ModelSafetyTest.GPUBaseDataSetUUID ctx.Data["CombatDataSetName"] = setting.ModelSafetyTest.GPUCombatDataSetName ctx.Data["CombatDataSetUUID"] = setting.ModelSafetyTest.GPUCombatDataSetUUID + prepareCloudbrainOneSpecs(ctx) } else { ctx.Data["engine_id"] = ctx.QueryInt("engine_id") ctx.Data["pool_id"] = ctx.Query("pool_id") @@ -988,11 +989,20 @@ func modelSafetyNewDataPrepare(ctx *context.Context) error { ctx.Data["BaseDataSetUUID"] = setting.ModelSafetyTest.NPUBaseDataSetUUID ctx.Data["CombatDataSetName"] = setting.ModelSafetyTest.NPUCombatDataSetName ctx.Data["CombatDataSetUUID"] = setting.ModelSafetyTest.NPUCombatDataSetUUID - } - prepareCloudbrainOneSpecs(ctx) + var engines modelarts.Engine + if err := json.Unmarshal([]byte(setting.Engines), &engines); err != nil { + ctx.ServerError("json.Unmarshal failed:", err) + } + ctx.Data["engines"] = engines.Info - prepareCloudbrainTwoInferenceSpecs(ctx) + var versionInfos modelarts.VersionInfo + if err := json.Unmarshal([]byte(setting.EngineVersions), &versionInfos); err != nil { + ctx.ServerError("json.Unmarshal failed:", err) + } + ctx.Data["engine_versions"] = versionInfos.Version + prepareCloudbrainTwoInferenceSpecs(ctx) + } return nil }