From fcde2ce3dad6512de6b8182ee7f705198a789776 Mon Sep 17 00:00:00 2001 From: AMATH <116212274+amathxbt@users.noreply.github.com> Date: Sat, 9 May 2026 19:42:44 +0100 Subject: [PATCH] fix: add missing @classmethod decorator to load_model_tokenizer The load_model_tokenizer method in HuggingFaceModelMixin was missing the @classmethod decorator, causing a TypeError when called on the class. Without it, 'cls' receives the first positional argument (model_name) instead of the class, making the method uncallable as intended. --- demo/nesa/backend/hf_models.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/demo/nesa/backend/hf_models.py b/demo/nesa/backend/hf_models.py index 4f3dc5c..7c78922 100644 --- a/demo/nesa/backend/hf_models.py +++ b/demo/nesa/backend/hf_models.py @@ -39,6 +39,7 @@ class HuggingFaceModelMixin: def __init__(self, **kwargs): warnings.warn("Instantiation is deprecated.", DeprecationWarning) + @classmethod def load_model_tokenizer(cls,model_name): """ load model and tokenizer using configuration and local files. @@ -127,4 +128,4 @@ def detokenize(self, token_ids: List[int]) -> str: model_mixin.load_model_and_tokenizer() input_text = "I am not feeling bad today." outputs = model_mixin.perform_inference(input_text) - pprint(outputs, indent=4) \ No newline at end of file + pprint(outputs, indent=4)