From e24ca9cb02a70c38cc17406f107ebd3c81e27d12 Mon Sep 17 00:00:00 2001 From: Jared Van Bortel Date: Mon, 4 Mar 2024 17:37:42 -0500 Subject: [PATCH] convert-hf : fix flake8 warnings in CI --- convert-hf-to-gguf.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/convert-hf-to-gguf.py b/convert-hf-to-gguf.py index ffdba7444..e72b1ee2a 100755 --- a/convert-hf-to-gguf.py +++ b/convert-hf-to-gguf.py @@ -28,6 +28,9 @@ from convert import HfVocab ###### MODEL DEFINITIONS ###### +AnyModel = TypeVar("AnyModel", bound="type[Model]") + + class SentencePieceTokenTypes(IntEnum): NORMAL = 1 UNKNOWN = 2 @@ -36,7 +39,6 @@ class SentencePieceTokenTypes(IntEnum): UNUSED = 5 BYTE = 6 -AnyModel = TypeVar("AnyModel", bound="type[Model]") class Model(ABC): _model_classes: dict[str, type[Model]] = {} @@ -187,10 +189,12 @@ class Model(ABC): @classmethod def register(cls, *names: str) -> Callable[[AnyModel], AnyModel]: assert names + def func(modelcls: type[Model]): for name in names: cls._model_classes[name] = modelcls return modelcls + return func @classmethod