Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
FIX Correctly call element_size (huggingface#1635)
Should fix the error introduced by huggingface#1630. AFAICT, element_size should be called on the parameter, not the dtype. Unfortunately, I had issues getting older PyTorch versions to work with bnb, so I haven't tested the initial issue. To be safe, I also re-added the previous code path using itemsize, although it might be unnecessary (we would have to check the PyTorch code to verify when the different attributes/methods were added).
- Loading branch information