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
d3ce048c
Unverified
Commit
d3ce048c
authored
Jul 21, 2023
by
Younes Belkada
Committed by
GitHub
Jul 21, 2023
Browse files
[`bnb`] Add simple check for bnb import (#24995)
add simple check for bnb
parent
f1a1eb4a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
1 deletion
+8
-1
src/transformers/utils/import_utils.py
src/transformers/utils/import_utils.py
+8
-1
No files found.
src/transformers/utils/import_utils.py
View file @
d3ce048c
...
...
@@ -504,7 +504,14 @@ def is_ipex_available():
def
is_bitsandbytes_available
():
return
_bitsandbytes_available
if
not
is_torch_available
():
return
False
# bitsandbytes throws an error if cuda is not available
# let's avoid that by adding a simple check
import
torch
return
_bitsandbytes_available
and
torch
.
cuda
.
is_available
()
def
is_torchdistx_available
():
...
...
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