bugfix: pydantic settings missing / changed fields
This commit is contained in:
parent
0f3c474a49
commit
6f70cc4b7d
1 changed files with 3 additions and 3 deletions
|
@ -30,14 +30,14 @@ from llama_cpp.server.app import create_app, Settings
|
|||
|
||||
if __name__ == "__main__":
|
||||
parser = argparse.ArgumentParser()
|
||||
for name, field in Settings.__model_fields__.items():
|
||||
description = field.field_info.description
|
||||
for name, field in Settings.model_fields.items():
|
||||
description = field.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_,
|
||||
type=field.annotation if field.annotation is not None else str,
|
||||
help=description,
|
||||
)
|
||||
|
||||
|
|
Loading…
Reference in a new issue