Skip to content

Commit

Permalink
Quantization: Enhance bnb error message (huggingface#31160)
Browse files Browse the repository at this point in the history
enhance error message
  • Loading branch information
younesbelkada authored and vasqu committed Jun 1, 2024
1 parent 390c9f4 commit 09daece
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/transformers/quantizers/quantizer_bnb_4bit.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def validate_environment(self, *args, **kwargs):
if not (is_accelerate_available() and is_bitsandbytes_available()):
raise ImportError(
"Using `bitsandbytes` 8-bit quantization requires Accelerate: `pip install accelerate` "
"and the latest version of bitsandbytes: `pip install -i https://pypi.org/simple/ bitsandbytes`"
"and the latest version of bitsandbytes: `pip install -U bitsandbytes`"
)

if kwargs.get("from_tf", False) or kwargs.get("from_flax", False):
Expand Down
2 changes: 1 addition & 1 deletion src/transformers/quantizers/quantizer_bnb_8bit.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def validate_environment(self, *args, **kwargs):
if not (is_accelerate_available() and is_bitsandbytes_available()):
raise ImportError(
"Using `bitsandbytes` 8-bit quantization requires Accelerate: `pip install accelerate` "
"and the latest version of bitsandbytes: `pip install -i https://pypi.org/simple/ bitsandbytes`"
"and the latest version of bitsandbytes: `pip install -U bitsandbytes`"
)

if kwargs.get("from_tf", False) or kwargs.get("from_flax", False):
Expand Down

0 comments on commit 09daece

Please sign in to comment.