Skip to content

Commit e2b2083

Browse files
Revert "Fix breaking bug in save.py with interpreting quantization_method as …" (#652)
This reverts commit 30605de.
1 parent 30605de commit e2b2083

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

unsloth/save.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -853,13 +853,9 @@ def save_to_gguf(
853853
model_dtype = "f16" if model_dtype == "float16" else "bf16"
854854

855855
# Convert quantization_method to list
856-
if isinstance(quantization_method, list): pass
857-
elif isinstance(quantization_method, str): quantization_method = [ quantization_method, ]
858-
elif isinstance(quantization_method, tuple): quantization_method = list(quantization_method)
859-
else:
860-
raise TypeError("Unsloth: quantization_method can only be a string or a list of strings")
861-
pass
862-
856+
quantization_method = \
857+
quantization_method if type(quantization_method) is list else list(quantization_method)
858+
863859
# Check if bfloat16 is supported
864860
if model_dtype == "bf16" and not torch.cuda.is_bf16_supported():
865861
logger.warning(

0 commit comments

Comments
 (0)