Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
transformers
Commits
fc5d3e11
Unverified
Commit
fc5d3e11
authored
May 31, 2024
by
Younes Belkada
Committed by
GitHub
May 31, 2024
Browse files
Quantization: Enhance bnb error message (#31160)
enhance error message
parent
bd9d1ddf
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
2 deletions
+2
-2
src/transformers/quantizers/quantizer_bnb_4bit.py
src/transformers/quantizers/quantizer_bnb_4bit.py
+1
-1
src/transformers/quantizers/quantizer_bnb_8bit.py
src/transformers/quantizers/quantizer_bnb_8bit.py
+1
-1
No files found.
src/transformers/quantizers/quantizer_bnb_4bit.py
View file @
fc5d3e11
...
@@ -63,7 +63,7 @@ class Bnb4BitHfQuantizer(HfQuantizer):
...
@@ -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
):
...
...
src/transformers/quantizers/quantizer_bnb_8bit.py
View file @
fc5d3e11
...
@@ -64,7 +64,7 @@ class Bnb8BitHfQuantizer(HfQuantizer):
...
@@ -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
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment