Show default value when --help is called

This commit is contained in:
Andrei Betlen 2023-05-08 14:21:15 -04:00
parent 022e9ebcb8
commit 0d6c60097a

View file

@ -29,7 +29,9 @@ import uvicorn
from llama_cpp.server.app import create_app, Settings from llama_cpp.server.app import create_app, Settings
if __name__ == "__main__": if __name__ == "__main__":
parser = argparse.ArgumentParser() parser = argparse.ArgumentParser(
formatter_class=argparse.ArgumentDefaultsHelpFormatter
)
for name, field in Settings.__fields__.items(): for name, field in Settings.__fields__.items():
parser.add_argument( parser.add_argument(
f"--{name}", f"--{name}",