fix: display help with correct default values (#481)

Signed-off-by: Sébastien Prud'homme <sebastien.prudhomme@gmail.com>
This commit is contained in:
Sébastien Prud'homme 2023-06-03 14:25:30 +02:00 committed by GitHub
parent 96794851b3
commit aa6cdf16c8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

20
main.go
View File

@ -43,58 +43,58 @@ func main() {
}, },
&cli.IntFlag{ &cli.IntFlag{
Name: "threads", Name: "threads",
DefaultText: "Number of threads used for parallel computation. Usage of the number of physical cores in the system is suggested.", Usage: "Number of threads used for parallel computation. Usage of the number of physical cores in the system is suggested.",
EnvVars: []string{"THREADS"}, EnvVars: []string{"THREADS"},
Value: 4, Value: 4,
}, },
&cli.StringFlag{ &cli.StringFlag{
Name: "models-path", Name: "models-path",
DefaultText: "Path containing models used for inferencing", Usage: "Path containing models used for inferencing",
EnvVars: []string{"MODELS_PATH"}, EnvVars: []string{"MODELS_PATH"},
Value: filepath.Join(path, "models"), Value: filepath.Join(path, "models"),
}, },
&cli.StringFlag{ &cli.StringFlag{
Name: "preload-models", Name: "preload-models",
DefaultText: "A List of models to apply in JSON at start", Usage: "A List of models to apply in JSON at start",
EnvVars: []string{"PRELOAD_MODELS"}, EnvVars: []string{"PRELOAD_MODELS"},
}, },
&cli.StringFlag{ &cli.StringFlag{
Name: "preload-models-config", Name: "preload-models-config",
DefaultText: "A List of models to apply at startup. Path to a YAML config file", Usage: "A List of models to apply at startup. Path to a YAML config file",
EnvVars: []string{"PRELOAD_MODELS_CONFIG"}, EnvVars: []string{"PRELOAD_MODELS_CONFIG"},
}, },
&cli.StringFlag{ &cli.StringFlag{
Name: "config-file", Name: "config-file",
DefaultText: "Config file", Usage: "Config file",
EnvVars: []string{"CONFIG_FILE"}, EnvVars: []string{"CONFIG_FILE"},
}, },
&cli.StringFlag{ &cli.StringFlag{
Name: "address", Name: "address",
DefaultText: "Bind address for the API server.", Usage: "Bind address for the API server.",
EnvVars: []string{"ADDRESS"}, EnvVars: []string{"ADDRESS"},
Value: ":8080", Value: ":8080",
}, },
&cli.StringFlag{ &cli.StringFlag{
Name: "image-path", Name: "image-path",
DefaultText: "Image directory", Usage: "Image directory",
EnvVars: []string{"IMAGE_PATH"}, EnvVars: []string{"IMAGE_PATH"},
Value: "", Value: "",
}, },
&cli.StringFlag{ &cli.StringFlag{
Name: "backend-assets-path", Name: "backend-assets-path",
DefaultText: "Path used to extract libraries that are required by some of the backends in runtime.", Usage: "Path used to extract libraries that are required by some of the backends in runtime.",
EnvVars: []string{"BACKEND_ASSETS_PATH"}, EnvVars: []string{"BACKEND_ASSETS_PATH"},
Value: "/tmp/localai/backend_data", Value: "/tmp/localai/backend_data",
}, },
&cli.IntFlag{ &cli.IntFlag{
Name: "context-size", Name: "context-size",
DefaultText: "Default context size of the model", Usage: "Default context size of the model",
EnvVars: []string{"CONTEXT_SIZE"}, EnvVars: []string{"CONTEXT_SIZE"},
Value: 512, Value: 512,
}, },
&cli.IntFlag{ &cli.IntFlag{
Name: "upload-limit", Name: "upload-limit",
DefaultText: "Default upload-limit. MB", Usage: "Default upload-limit. MB",
EnvVars: []string{"UPLOAD_LIMIT"}, EnvVars: []string{"UPLOAD_LIMIT"},
Value: 15, Value: 15,
}, },