feat: add tasks closes #74

This commit is contained in:
2024-04-12 20:36:23 +01:00
parent 143ad3b02b
commit eb20c1b0ac
21 changed files with 986 additions and 232 deletions

View File

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