Update vision.py

This commit is contained in:
Daniel Han 2025-08-07 07:10:36 -07:00
commit 972d1bb659

View file

@ -424,7 +424,7 @@ class FastBaseModel:
pass
# Fix AttributeError: 'BitsAndBytesConfig' object has no attribute 'get_loading_attributes'
if not hasattr(bnb_config, "get_loading_attributes"):
if bnb_config is not None and not hasattr(bnb_config, "get_loading_attributes"):
bnb_config.get_loading_attributes = lambda *args, **kwargs: {}
# Cannot be None, since HF now checks for the config