Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update lime.py #262

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Update lime.py #262

wants to merge 1 commit into from

Conversation

yuzhaouoe
Copy link

Convert tensor's dtype to "float" before moving to CPU, which avoids errors when using "bf16"

Description

add .float() before .cpu() to support half precision data type

Checklist

  • I've read the CODE_OF_CONDUCT.md document.
  • I've read the CONTRIBUTING.md guide.
  • I've successfully run the style checks using make fix-style.
  • I've written tests for all new methods and classes that I created and successfully ran make test.
  • I've written the docstring in Google format for all the methods and classes that I used.

Convert tensor's dtype to "float" before moving to CPU, which avoids errors when using "bf16"
@gsarti
Copy link
Member

gsarti commented Apr 15, 2024

Hi @yuzhaouoe, thanks for opening this PR! Could you provide a minimal code snippet to reproduce the issue with bfloat16 you mention?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants