From 29f094bbcf21f24d6bdb1a4ee95d3a501387f08f Mon Sep 17 00:00:00 2001 From: Andrei Betlen Date: Mon, 8 May 2023 14:46:25 -0400 Subject: [PATCH] Bugfix: not falling back to environment variables when default is value is set. --- llama_cpp/server/__main__.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/llama_cpp/server/__main__.py b/llama_cpp/server/__main__.py index 18011e3..4fe1d94 100644 --- a/llama_cpp/server/__main__.py +++ b/llama_cpp/server/__main__.py @@ -29,16 +29,16 @@ import uvicorn from llama_cpp.server.app import create_app, Settings if __name__ == "__main__": - parser = argparse.ArgumentParser( - formatter_class=argparse.ArgumentDefaultsHelpFormatter - ) + parser = argparse.ArgumentParser() for name, field in Settings.__fields__.items(): + description = field.field_info.description + if field.default is not None and description is not None: + description += f" (default: {field.default})" parser.add_argument( f"--{name}", dest=name, type=field.type_, - default=field.default, - help=field.field_info.description, + help=description, ) args = parser.parse_args()