Unverified Commit d3ce048c authored by Younes Belkada's avatar Younes Belkada Committed by GitHub
Browse files

[`bnb`] Add simple check for bnb import (#24995)

add simple check for bnb
parent f1a1eb4a
......@@ -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():
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment