From 6f70cc4b7dd950a95708ed7e7da9ac550e87a76c Mon Sep 17 00:00:00 2001 From: Andrei Betlen Date: Sun, 9 Jul 2023 18:03:31 -0400 Subject: [PATCH] bugfix: pydantic settings missing / changed fields --- llama_cpp/server/__main__.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/llama_cpp/server/__main__.py b/llama_cpp/server/__main__.py index 2110db3..995dd44 100644 --- a/llama_cpp/server/__main__.py +++ b/llama_cpp/server/__main__.py @@ -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, )