Quantization: Enhance bnb error message (#31160)

enhance error message
This commit is contained in:
Younes Belkada 2024-05-31 12:36:46 +02:00 committed by GitHub
parent bd9d1ddf41
commit fc5d3e112a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View File

@ -63,7 +63,7 @@ class Bnb4BitHfQuantizer(HfQuantizer):
if not (is_accelerate_available() and is_bitsandbytes_available()): if not (is_accelerate_available() and is_bitsandbytes_available()):
raise ImportError( raise ImportError(
"Using `bitsandbytes` 8-bit quantization requires Accelerate: `pip install accelerate` " "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): if kwargs.get("from_tf", False) or kwargs.get("from_flax", False):

View File

@ -64,7 +64,7 @@ class Bnb8BitHfQuantizer(HfQuantizer):
if not (is_accelerate_available() and is_bitsandbytes_available()): if not (is_accelerate_available() and is_bitsandbytes_available()):
raise ImportError( raise ImportError(
"Using `bitsandbytes` 8-bit quantization requires Accelerate: `pip install accelerate` " "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): if kwargs.get("from_tf", False) or kwargs.get("from_flax", False):