From 141293a75b564a8699e0acba1da24d9aa1cf0ab1 Mon Sep 17 00:00:00 2001 From: Andrei Betlen Date: Fri, 19 Jan 2024 08:17:49 -0500 Subject: [PATCH] Fix python3.8 support --- llama_cpp/server/cli.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/llama_cpp/server/cli.py b/llama_cpp/server/cli.py index 8e32d2c..3dd0076 100644 --- a/llama_cpp/server/cli.py +++ b/llama_cpp/server/cli.py @@ -55,7 +55,7 @@ def _parse_bool_arg(arg: str | bytes | bool) -> bool: raise ValueError(f"Invalid boolean argument: {arg}") -def add_args_from_model(parser: argparse.ArgumentParser, model: type[BaseModel]): +def add_args_from_model(parser: argparse.ArgumentParser, model: Type[BaseModel]): """Add arguments from a pydantic model to an argparse parser.""" for name, field in model.model_fields.items(): @@ -83,7 +83,7 @@ def add_args_from_model(parser: argparse.ArgumentParser, model: type[BaseModel]) ) -T = TypeVar("T", bound=type[BaseModel]) +T = TypeVar("T", bound=Type[BaseModel]) def parse_model_from_args(model: T, args: argparse.Namespace) -> T: