Skip to content

Commit

Permalink
Revert "Fix breaking bug in save.py with interpreting quantization_me…
Browse files Browse the repository at this point in the history
…thod as …" (#652)

This reverts commit 30605de.
  • Loading branch information
danielhanchen committed Jun 16, 2024
1 parent 30605de commit e2b2083
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions unsloth/save.py
Original file line number Diff line number Diff line change
Expand Up @@ -853,13 +853,9 @@ def save_to_gguf(
model_dtype = "f16" if model_dtype == "float16" else "bf16"

# Convert quantization_method to list
if isinstance(quantization_method, list): pass
elif isinstance(quantization_method, str): quantization_method = [ quantization_method, ]
elif isinstance(quantization_method, tuple): quantization_method = list(quantization_method)
else:
raise TypeError("Unsloth: quantization_method can only be a string or a list of strings")
pass

quantization_method = \
quantization_method if type(quantization_method) is list else list(quantization_method)

# Check if bfloat16 is supported
if model_dtype == "bf16" and not torch.cuda.is_bf16_supported():
logger.warning(
Expand Down

0 comments on commit e2b2083

Please sign in to comment.