From f7e1eb745787c44bc70aacbd9e5abfb35226ca9d Mon Sep 17 00:00:00 2001 From: Daniel Han Date: Fri, 8 Aug 2025 09:15:52 -0700 Subject: [PATCH] Update vision.py --- unsloth/models/vision.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/unsloth/models/vision.py b/unsloth/models/vision.py index 38606c4ff9..5524d8f16d 100644 --- a/unsloth/models/vision.py +++ b/unsloth/models/vision.py @@ -428,7 +428,13 @@ class FastBaseModel: 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 + if load_in_4bit: + # Ignore load_in_4bit / load_in_8bit for MXFP4 - best to get config file + if "gpt-oss" in model_name.lower(): + pass + else: + kwargs["quantization_config"] = bnb_config + pass # Check if using forced float32 - we load it in bfloat16, then cast to float16! torch_dtype = dtype