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__":
|
if __name__ == "__main__":
|
||||||
parser = argparse.ArgumentParser()
|
parser = argparse.ArgumentParser()
|
||||||
for name, field in Settings.__model_fields__.items():
|
for name, field in Settings.model_fields.items():
|
||||||
description = field.field_info.description
|
description = field.description
|
||||||
if field.default is not None and description is not None:
|
if field.default is not None and description is not None:
|
||||||
description += f" (default: {field.default})"
|
description += f" (default: {field.default})"
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
f"--{name}",
|
f"--{name}",
|
||||||
dest=name,
|
dest=name,
|
||||||
type=field.type_,
|
type=field.annotation if field.annotation is not None else str,
|
||||||
help=description,
|
help=description,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue