From aa6cdf16c81749e7ec12ad05b5e7207502ab2f98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Prud=27homme?= Date: Sat, 3 Jun 2023 14:25:30 +0200 Subject: [PATCH] fix: display help with correct default values (#481) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Sébastien Prud'homme --- main.go | 74 ++++++++++++++++++++++++++++----------------------------- 1 file changed, 37 insertions(+), 37 deletions(-) diff --git a/main.go b/main.go index 6c0f6af..16d5e31 100644 --- a/main.go +++ b/main.go @@ -42,61 +42,61 @@ func main() { EnvVars: []string{"CORS_ALLOW_ORIGINS"}, }, &cli.IntFlag{ - 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: 4, + Name: "threads", + Usage: "Number of threads used for parallel computation. Usage of the number of physical cores in the system is suggested.", + EnvVars: []string{"THREADS"}, + Value: 4, }, &cli.StringFlag{ - Name: "models-path", - DefaultText: "Path containing models used for inferencing", - EnvVars: []string{"MODELS_PATH"}, - Value: filepath.Join(path, "models"), + Name: "models-path", + Usage: "Path containing models used for inferencing", + EnvVars: []string{"MODELS_PATH"}, + Value: filepath.Join(path, "models"), }, &cli.StringFlag{ - Name: "preload-models", - DefaultText: "A List of models to apply in JSON at start", - EnvVars: []string{"PRELOAD_MODELS"}, + Name: "preload-models", + Usage: "A List of models to apply in JSON at start", + EnvVars: []string{"PRELOAD_MODELS"}, }, &cli.StringFlag{ - Name: "preload-models-config", - DefaultText: "A List of models to apply at startup. Path to a YAML config file", - EnvVars: []string{"PRELOAD_MODELS_CONFIG"}, + Name: "preload-models-config", + Usage: "A List of models to apply at startup. Path to a YAML config file", + EnvVars: []string{"PRELOAD_MODELS_CONFIG"}, }, &cli.StringFlag{ - Name: "config-file", - DefaultText: "Config file", - EnvVars: []string{"CONFIG_FILE"}, + Name: "config-file", + Usage: "Config file", + EnvVars: []string{"CONFIG_FILE"}, }, &cli.StringFlag{ - Name: "address", - DefaultText: "Bind address for the API server.", - EnvVars: []string{"ADDRESS"}, - Value: ":8080", + Name: "address", + Usage: "Bind address for the API server.", + EnvVars: []string{"ADDRESS"}, + Value: ":8080", }, &cli.StringFlag{ - Name: "image-path", - DefaultText: "Image directory", - EnvVars: []string{"IMAGE_PATH"}, - Value: "", + Name: "image-path", + Usage: "Image directory", + EnvVars: []string{"IMAGE_PATH"}, + Value: "", }, &cli.StringFlag{ - Name: "backend-assets-path", - DefaultText: "Path used to extract libraries that are required by some of the backends in runtime.", - EnvVars: []string{"BACKEND_ASSETS_PATH"}, - Value: "/tmp/localai/backend_data", + Name: "backend-assets-path", + Usage: "Path used to extract libraries that are required by some of the backends in runtime.", + EnvVars: []string{"BACKEND_ASSETS_PATH"}, + Value: "/tmp/localai/backend_data", }, &cli.IntFlag{ - Name: "context-size", - DefaultText: "Default context size of the model", - EnvVars: []string{"CONTEXT_SIZE"}, - Value: 512, + Name: "context-size", + Usage: "Default context size of the model", + EnvVars: []string{"CONTEXT_SIZE"}, + Value: 512, }, &cli.IntFlag{ - Name: "upload-limit", - DefaultText: "Default upload-limit. MB", - EnvVars: []string{"UPLOAD_LIMIT"}, - Value: 15, + Name: "upload-limit", + Usage: "Default upload-limit. MB", + EnvVars: []string{"UPLOAD_LIMIT"}, + Value: 15, }, }, Description: `