Revert "Fix breaking bug in save.py with interpreting quantization_method as …" (#652)

This reverts commit 30605dec23.
This commit is contained in:
Daniel Han 2024-06-16 14:43:08 +10:00 committed by GitHub
commit e2b2083b62
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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(