diff --git a/g4f/Provider/needs_auth/HuggingFaceAPI.py b/g4f/Provider/needs_auth/HuggingFaceAPI.py index 000dac909f5..dc783f4e3b5 100644 --- a/g4f/Provider/needs_auth/HuggingFaceAPI.py +++ b/g4f/Provider/needs_auth/HuggingFaceAPI.py @@ -19,9 +19,9 @@ class HuggingFaceAPI(OpenaiTemplate): @classmethod def get_models(cls, **kwargs): - HuggingChat.get_models() - cls.models = HuggingChat.text_models - cls.vision_models = HuggingChat.vision_models + if not cls.models: + HuggingChat.get_models() + cls.models = list(set(HuggingChat.text_models + cls.vision_models)) return cls.models @classmethod