Browse Source

修改GPU创建模型

Signed-off-by: zouap <zouap@pcl.ac.cn>
tags/v1.22.7.1
zouap 3 years ago
parent
commit
886b97cf0d
2 changed files with 4 additions and 4 deletions
  1. +2
    -2
      modules/setting/setting.go
  2. +2
    -2
      routers/repo/ai_model_manage.go

+ 2
- 2
modules/setting/setting.go View File

@@ -465,7 +465,7 @@ var (
MaxDuration int64
TrainGpuTypes string
TrainResourceSpecs string
MaxModelSize int64
MaxModelSize float64

//benchmark config
IsBenchmarkEnabled bool
@@ -1295,7 +1295,7 @@ func NewContext() {
MaxDuration = sec.Key("MAX_DURATION").MustInt64(14400)
TrainGpuTypes = sec.Key("TRAIN_GPU_TYPES").MustString("")
TrainResourceSpecs = sec.Key("TRAIN_RESOURCE_SPECS").MustString("")
MaxModelSize = sec.Key("MAX_MODEL_SIZE").MustInt64(500)
MaxModelSize = sec.Key("MAX_MODEL_SIZE").MustFloat64(500)

sec = Cfg.Section("benchmark")
IsBenchmarkEnabled = sec.Key("ENABLED").MustBool(false)


+ 2
- 2
routers/repo/ai_model_manage.go View File

@@ -213,7 +213,7 @@ func downloadModelFromCloudBrainTwo(modelUUID string, jobName string, parentDir
Files = append(Files, prefix+shortFile)
}
totalSize := storage.ObsGetFilesSize(setting.Bucket, Files)
if totalSize > setting.MaxModelSize*MODEL_MAX_SIZE {
if float64(totalSize) > setting.MaxModelSize*MODEL_MAX_SIZE {
return "", 0, errors.New("Cannot create model, as model is exceed " + fmt.Sprint(setting.MaxModelSize) + "G.")
}

@@ -247,7 +247,7 @@ func downloadModelFromCloudBrainOne(modelUUID string, jobName string, parentDir
Files = append(Files, modelSrcPrefix+shortFile)
}
totalSize := storage.MinioGetFilesSize(bucketName, Files)
if totalSize > setting.MaxModelSize*MODEL_MAX_SIZE {
if float64(totalSize) > setting.MaxModelSize*MODEL_MAX_SIZE {
return "", 0, errors.New("Cannot create model, as model is exceed " + fmt.Sprint(setting.MaxModelSize) + "G.")
}
size, err := storage.MinioCopyFiles(bucketName, modelSrcPrefix, destKeyNamePrefix, filterFiles)


Loading…
Cancel
Save