BERT Huggingface trainer api: ValueError: expected sequence of length 128 at dim 1 (got 314)
# ❓ Questions & Help

<!-- The GitHub issue tracker is primarly intended for bugs, feature requests,
     new models and benchmarks, and migration questions. For all other questions,
     we direct you to Stack Overflow (SO) where a whole community of PyTorch and
     Tensorflow enthusiast can help you out. Make sure to tag your question with the
     right deep learning framework as well as the huggingface-transformers tag: 
     https://stackoverflow.com/questions/tagged/huggingface-transformers 
     
     If your question wasn't answered after a period of time on Stack Overflow, you
     can always open a question on GitHub. You should then link to the SO question 
     that you posted.
     -->

## Details
<!-- Description of your issue -->
I'm using new trainer api in HuggingFace Transformers to train on a GLUE task (QQP). This error shows up during training.

This is the example I'm using https://colab.research.google.com/github/huggingface/blog/blob/master/notebooks/trainer/01_text_classification.ipynb

Only change I made is the task. In the notebook GLUE task is MNLI which I changed to QQP. While original MNLI task runs without errors, QQP task fails.

ValueError: expected sequence of length 128 at dim 1 (got 314)

<!-- You should first ask your question on SO, and only if
     you didn't get an answer ask it here on GitHub. -->

Please check my Stackoverflow question for more details
**https://stackoverflow.com/questions/62675482/bert-huggingface-trainer-api-valueerror-expected-sequence-of-length-128-at-dim**:

I can reproduce! Thank you for opening an issue, I'm looking into it now.<|||||>Same error (StackOverflow--> https://stackoverflow.com/questions/67004233/typeerror-zeros-like-argument-input-when-fine-tuning-on-mlm) what was the fix in the end @LysandreJik ?<|||||>@LysandreJik Is there any way to fix this (for what I presume is a model pretrained on the old HuggingFace version)?<|||||>Sorry just seeing this now - @neel04 are you still facing the issue? @msamogh can you open a new issue and fill in the issue template (with full error, environment, code run)? Thanks<|||||>I don't really remember what I was trying to do :sweat_smile: Sorry, couldn't help you more. I think the problem was some changes in the API, while the example notebooks weren't updated at that time - so the `max_length` argument (which took `int`) didn't work leading to that error. Now, its changed to a `str` whic represents padding strategy - and since it works now with my current problem, I personally don't think the issue remains anymore :hugs: 

I haven't done the training though, so I would surely update you if I encouter it again!

**EDIT:** My training works (albeit with small batch size), so you must have processed your data wrongly @msamogh. Check out the updated example notebooks to get an idea on how to build your datasets with the :hugs: `Datasets`  lib