diff --git a/unsloth/registry/_llama.py b/unsloth/registry/_llama.py index 35b40dccb9..f1d5f6da3e 100644 --- a/unsloth/registry/_llama.py +++ b/unsloth/registry/_llama.py @@ -1,6 +1,7 @@ from unsloth.registry.registry import ModelInfo, ModelMeta, _register_models _IS_LLAMA_REGISTERED = False +_IS_LLAMA_VISION_REGISTERED = False class LlamaModelInfo(ModelInfo): @classmethod @@ -65,7 +66,16 @@ def register_llama_models(): _register_models(LlamaMeta3_2) _IS_LLAMA_REGISTERED = True + +def register_llama_vision_models(): + global _IS_LLAMA_VISION_REGISTERED + if _IS_LLAMA_VISION_REGISTERED: + return + _register_models(LlamaMeta3_2_Vision) + _IS_LLAMA_VISION_REGISTERED = True + register_llama_models() +register_llama_vision_models() if __name__ == "__main__": from unsloth.registry.registry import MODEL_REGISTRY, _check_model_info diff --git a/unsloth/registry/registry.py b/unsloth/registry/registry.py index 172b6e8e86..2402282d6a 100644 --- a/unsloth/registry/registry.py +++ b/unsloth/registry/registry.py @@ -113,13 +113,18 @@ def register_model( def _check_model_info(model_id: str, properties: list[str] = ["lastModified"]): from huggingface_hub import HfApi from huggingface_hub import ModelInfo as HfModelInfo + from huggingface_hub.utils import RepositoryNotFoundError api = HfApi() try: model_info: HfModelInfo = api.model_info(model_id, expand=properties) except Exception as e: - print(f"Error getting model info for {model_id}: {e}") - model_info = None + + if isinstance(e, RepositoryNotFoundError): + print(f"\u2718 {model_id} not found") + model_info = None + else: + raise e return model_info