fix: hardcode default number of cores to '4' (#186)

This commit is contained in:
Ettore Di Giacinto 2023-05-04 18:14:58 +02:00 committed by GitHub
parent fdf75c6d0e
commit 9497a24127
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 23 additions and 13 deletions

11
main.go
View file

@ -5,11 +5,8 @@ import (
"os"
"path/filepath"
api "github.com/go-skynet/LocalAI/api"
model "github.com/go-skynet/LocalAI/pkg/model"
"github.com/jaypipes/ghw"
"github.com/rs/zerolog"
"github.com/rs/zerolog/log"
"github.com/urfave/cli/v2"
@ -24,12 +21,6 @@ func main() {
os.Exit(1)
}
threads := 4
cpu, err := ghw.CPU()
if err == nil {
threads = int(cpu.TotalCores)
}
app := &cli.App{
Name: "LocalAI",
Usage: "OpenAI compatible API for running LLaMA/GPT models locally on CPU with consumer grade hardware.",
@ -46,7 +37,7 @@ func main() {
Name: "threads",
DefaultText: "Number of threads used for parallel computation. Usage of the number of physical cores in the system is suggested.",
EnvVars: []string{"THREADS"},
Value: threads,
Value: 4,
},
&cli.StringFlag{
Name: "models-path",