Browse Source

benchmark types

tags/v1.22.1.3
lewis 4 years ago
parent
commit
06ab8e9ce9
2 changed files with 13 additions and 4 deletions
  1. +10
    -3
      models/cloudbrain.go
  2. +3
    -1
      routers/repo/cloudbrain.go

+ 10
- 3
models/cloudbrain.go View File

@@ -99,7 +99,7 @@ type Cloudbrain struct {
CanDel bool `xorm:"-"`
CanModify bool `xorm:"-"`
Type int
BenchmarkType string `xorm:"DEFAULT ''"`
BenchmarkType string `xorm:"DEFAULT ''"`

VersionID int64 //版本id
VersionName string `xorm:"INDEX"` //当前版本
@@ -386,8 +386,15 @@ type BenchmarkTypes struct {
}

type BenchmarkType struct {
Id int `json:"id"`
Value string `json:"value"`
Id int `json:"id"`
First string `json:"first"` //一级算法类型名称
Second []*BenchmarkDataset `json:"second"`
}

type BenchmarkDataset struct {
Id int `json:"id"`
Value string `json:"value"` //二级算法类型名称
Attachment string `json:"attachment"` //数据集的uuid
}

type GpuInfos struct {


+ 3
- 1
routers/repo/cloudbrain.go View File

@@ -127,7 +127,9 @@ func cloudBrainNewDataPrepare(ctx *context.Context) error {
ctx.Data["benchmark_categories"] = categories.Category

if benchmarkTypes == nil {
json.Unmarshal([]byte(setting.BenchmarkTypes), &benchmarkTypes)
if err := json.Unmarshal([]byte(setting.BenchmarkTypes), &benchmarkTypes); err != nil {
log.Error("json.Unmarshal BenchmarkTypes(%s) failed:%v", setting.BenchmarkTypes, err, ctx.Data["MsgID"])
}
}
ctx.Data["benchmark_types"] = benchmarkTypes.BenchmarkType



Loading…
Cancel
Save