We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
IterableDataset.from_generator crashes when using BFloat16:
IterableDataset.from_generator
File "/usr/local/lib/python3.11/site-packages/datasets/utils/_dill.py", line 169, in _save_torchTensor args = (obj.detach().cpu().numpy(),) ^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: Got unsupported ScalarType BFloat16
import torch from datasets import IterableDataset def demo(x): yield {"x": x} x = torch.tensor([1.], dtype=torch.bfloat16) dataset = IterableDataset.from_generator( demo, gen_kwargs=dict(x=x), ) example = next(iter(dataset)) print(example)
Code sample should print:
{'x': tensor([1.], dtype=torch.bfloat16)}
datasets==2.20.0 torch==2.2.2
The text was updated successfully, but these errors were encountered:
@lhoestq Thank you for merging #6607, but unfortunately the issue persists for IterableDataset 😔
IterableDataset
Sorry, something went wrong.
Hi ! I opened #7002 to fix this bug
Amazing, thank you so much @lhoestq! 🙏
Successfully merging a pull request may close this issue.
Describe the bug
IterableDataset.from_generator
crashes when using BFloat16:Steps to reproduce the bug
Expected behavior
Code sample should print:
Environment info
The text was updated successfully, but these errors were encountered: