Bugfix: not falling back to environment variables when default is value is set.
This commit is contained in:
parent
6d69461ef5
commit
29f094bbcf
1 changed files with 5 additions and 5 deletions
|
@ -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()
|
||||
|
|
Loading…
Reference in a new issue