From 3bc471b1af81db9be21c1dbdd1bd01693686b9d3 Mon Sep 17 00:00:00 2001 From: Daniel Han Date: Tue, 25 Nov 2025 07:45:14 -0800 Subject: [PATCH] Update loader.py --- unsloth/models/loader.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/unsloth/models/loader.py b/unsloth/models/loader.py index 1bc8e265a2..828fe17320 100644 --- a/unsloth/models/loader.py +++ b/unsloth/models/loader.py @@ -258,6 +258,7 @@ class FastLanguageModel(FastLlamaModel): if model_name.lower().endswith("-bf16"): load_in_4bit = False load_in_8bit = False + load_in_fp8 = False load_in_16bit = True if USE_MODELSCOPE and not os.path.exists(model_name): @@ -386,7 +387,7 @@ class FastLanguageModel(FastLlamaModel): if model_name.lower().endswith("-bf16"): load_in_4bit = False load_in_8bit = False - load_in_fp8 = False + load_in_fp8 = False load_in_16bit = True model_config = AutoConfig.from_pretrained( @@ -710,9 +711,10 @@ class FastModel(FastBaseModel): ) load_in_4bit = False load_in_8bit = False + load_in_fp8 = False load_in_16bit = False - if int(load_in_4bit) + int(load_in_8bit) + int(load_in_16bit) >= 2: + if int(load_in_4bit) + int(load_in_8bit) + int(load_in_16bit) + int(load_in_fp8 != False) >= 2: raise RuntimeError( "Unsloth: Can only load in 4bit or 8bit or 16bit, not a combination!\n" "Also, we by default set `load_in_4bit = True`.\n"