feat: add tasks closes #74
This commit is contained in:
@@ -7,10 +7,18 @@ import (
|
||||
"github.com/charmbracelet/log"
|
||||
)
|
||||
|
||||
type WorkerConfig struct {
|
||||
NumberOfWorkers int `toml:"number_of_workers"`
|
||||
Pulling string `toml:"pulling_time"`
|
||||
}
|
||||
|
||||
type Config struct {
|
||||
Hostname string
|
||||
Port int
|
||||
NumberOfWorkers int `toml:"number_of_workers"`
|
||||
NumberOfWorkers int `toml:"number_of_workers"`
|
||||
SupressCuda int `toml:"supress_cuda"`
|
||||
|
||||
GpuWorker WorkerConfig `toml:"Worker"`
|
||||
}
|
||||
|
||||
func LoadConfig() Config {
|
||||
@@ -25,10 +33,21 @@ func LoadConfig() Config {
|
||||
Hostname: "localhost",
|
||||
Port: 8000,
|
||||
NumberOfWorkers: 10,
|
||||
GpuWorker: WorkerConfig{
|
||||
NumberOfWorkers: 1,
|
||||
Pulling: "500ms",
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
var conf Config
|
||||
_, err = toml.Decode(string(dat), &conf)
|
||||
|
||||
if conf.SupressCuda == 1 {
|
||||
log.Warn("Supressing Cuda Messages!")
|
||||
os.Setenv("TF_CPP_MIN_VLOG_LEVEL", "3")
|
||||
os.Setenv("TF_CPP_MIN_LOG_LEVEL", "3")
|
||||
}
|
||||
|
||||
return conf
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user