Skip to content

Commit 9d80ce2

Browse files
committed
Update loader.py
1 parent c2dbc03 commit 9d80ce2

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

‎unsloth/models/loader.py‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,8 @@ def from_pretrained(
202202
pass
203203
# Check if 4bit is allowed specifically for AMD
204204
if not ALLOW_BITSANDBYTES and not use_exact_model_name:
205-
print("Unsloth: AMD currently is not stable with 4bit bitsandbytes. Disabling for now.")
205+
if load_in_4bit or load_in_8bit or model_name.lower().endswith("-bnb-4bit"):
206+
print("Unsloth: AMD currently is not stable with 4bit bitsandbytes. Disabling for now.")
206207
load_in_4bit = False
207208

208209
old_model_name = model_name
@@ -650,7 +651,8 @@ def from_pretrained(
650651
)
651652
# Check if 4bit is allowed specifically for AMD
652653
if not ALLOW_BITSANDBYTES and not use_exact_model_name:
653-
print("Unsloth: AMD currently is not stable with 4bit bitsandbytes. Disabling for now.")
654+
if load_in_4bit or load_in_8bit or model_name.lower().endswith("-bnb-4bit"):
655+
print("Unsloth: AMD currently is not stable with 4bit bitsandbytes. Disabling for now.")
654656
load_in_4bit = False
655657

656658
old_model_name = model_name

0 commit comments

Comments
 (0)