bugfix: pydantic settings missing / changed fields

This commit is contained in:
Andrei Betlen 2023-07-09 18:03:31 -04:00
parent 0f3c474a49
commit 6f70cc4b7d

View file

@ -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,
)