Browse Source

出错返回信息修改。

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

+ 13
- 3
routers/repo/aisafety.go View File

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


Loading…
Cancel
Save