Update vision.py

This commit is contained in:
Daniel Han 2025-08-07 05:03:21 -07:00
commit 5eebb206ae

View file

@ -423,6 +423,10 @@ class FastBaseModel:
os.environ["UNSLOTH_ENABLE_FULL_FINETUNING"] = "0"
pass
# Fix AttributeError: 'BitsAndBytesConfig' object has no attribute 'get_loading_attributes'
if 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
if load_in_4bit: kwargs["quantization_config"] = bnb_config