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
ValueError: Unable to create tensor, you should probably activate truncation and/or padding with 'padding=True' 'truncation=True' to have batched tensors with the same length. #15505
Comments
Ah actually this is linked to the summarization example in the course @lewtun |
Hi @anum94, thanks for reporting this bug! The cause of the error is that the The fix is to add the following line before the data collator: tokenized_datasets = tokenized_datasets.remove_columns(books_dataset["train"].column_names) I'll post a fix in the website and Colab too - thanks! |
Thank you.
instead of Thanks for your help and the prompt response. |
When I used |
I'm following this tutorial and facing this same error of Unable to create tensor, you should probably activate truncation and/or padding with 'padding=True' 'truncation=True' to have batched tensors with the same length. during model training. I'm not sure how to implement the solution which worked in the case above. Any help will be appreciated. |
I am having the same issue^ |
Upgrading numpy to 1.24 resolved this issue:
|
Maybe @SaulLu can help?
Information
I am following the text summarization tutorial on hugging face website which uses the mt5-small model. It explains step by step on how to perform a text summarization task.
To reproduce
Steps to reproduce the behavior:
The text was updated successfully, but these errors were encountered: