longformertokenizerFast gives error
Author: manishiitg
Pull request: no
Labels: name: wontfix

## Environment info
<!-- You can run the command `transformers-cli env` and copy-and-paste its output below.
     Don't forget to fill out the missing fields in that output! -->
     
- `transformers` version:
- Platform:
- Python version:
- PyTorch version (GPU?):
- Tensorflow version (GPU?):
- Using GPU in script?:
- Using distributed or parallel set-up in script?:

### Who can help
<!-- Your issue will be replied to more quickly if you can figure out the right person to tag with @
 If you know how to use git blame, that is the easiest way, otherwise, here is a rough guide of **who to tag**.
 Please tag fewer than 3 people.
 
 albert, bert, GPT2, XLM: @LysandreJik 
 tokenizers: @mfuntowicz
 Trainer: @sgugger
 Speed and Memory Benchmarks: @patrickvonplaten
 Model Cards: @julien-c
 Translation: @sshleifer
 Summarization: @sshleifer
 TextGeneration: @TevenLeScao 
 examples/distillation: @VictorSanh
 nlp datasets: [different repo](https://github.com/huggingface/nlp)
 rust tokenizers: [different repo](https://github.com/huggingface/tokenizers)
 Text Generation: @TevenLeScao
 blenderbot: @mariamabarham
 Bart: @sshleifer
 Marian: @sshleifer
 T5: @patrickvonplaten
 Longformer/Reformer: @patrickvonplaten
 TransfoXL/XLNet: @TevenLeScao 
 examples/seq2seq: @sshleifer
 tensorflow: @jplu 
documentation: @sgugger
 -->

## Information

Model I am using (Bert, XLNet ...):

The problem arises when using:
* [ ] the official example scripts: (give details below)
* [ X ] my own modified scripts: (give details below)

The tasks I am working on is:
* [ ] an official GLUE/SQUaD task: (give the name)
* [ X ] my own task or dataset: (give details below)

## To reproduce

using LongformerTokenizerFast gives error. but using LongformerTokenizer works without any issues keeping everything same

```

---------------------------------------------------------------------------
Exception                                 Traceback (most recent call last)
<ipython-input-39-263240bbee7e> in <module>
----> 1 main()

<ipython-input-37-2c27a8a4db79> in main()
     99     )
    100 
--> 101     train_dataset = CustomDataset(data_args, tokenizer=tokenizer) if training_args.do_train else None
    102     eval_dataset = CustomDataset(data_args, tokenizer=tokenizer, mode="test") if training_args.do_eval else None
    103 

<ipython-input-36-85278feb74ec> in __init__(self, args, tokenizer, limit_length, mode)
    184                     max_length=args.max_seq_length,
    185                     label_list=label_list,
--> 186                     output_mode=self.output_mode,
    187                 )
    188                 start = time.time()

/opt/conda/lib/python3.7/site-packages/transformers/data/processors/glue.py in glue_convert_examples_to_features(examples, tokenizer, max_length, task, label_list, output_mode)
     63         return _tf_glue_convert_examples_to_features(examples, tokenizer, max_length=max_length, task=task)
     64     return _glue_convert_examples_to_features(
---> 65         examples, tokenizer, max_length=max_length, task=task, label_list=label_list, output_mode=output_mode
     66     )
     67 

/opt/conda/lib/python3.7/site-packages/transformers/data/processors/glue.py in _glue_convert_examples_to_features(examples, tokenizer, max_length, task, label_list, output_mode)
    133         max_length=max_length,
    134         padding="max_length",
--> 135         truncation=True,
    136     )
    137 

/opt/conda/lib/python3.7/site-packages/transformers/tokenization_utils_base.py in __call__(self, text, text_pair, add_special_tokens, padding, truncation, max_length, stride, is_pretokenized, pad_to_multiple_of, return_tensors, return_token_type_ids, return_attention_mask, return_overflowing_tokens, return_special_tokens_mask, return_offsets_mapping, return_length, verbose, **kwargs)
   1918                 return_length=return_length,
   1919                 verbose=verbose,
-> 1920                 **kwargs,
   1921             )
   1922         else:

/opt/conda/lib/python3.7/site-packages/transformers/tokenization_utils_base.py in batch_encode_plus(self, batch_text_or_text_pairs, add_special_tokens, padding, truncation, max_length, stride, is_pretokenized, pad_to_multiple_of, return_tensors, return_token_type_ids, return_attention_mask, return_overflowing_tokens, return_special_tokens_mask, return_offsets_mapping, return_length, verbose, **kwargs)
   2103             return_length=return_length,
   2104             verbose=verbose,
-> 2105             **kwargs,
   2106         )
   2107 

/opt/conda/lib/python3.7/site-packages/transformers/tokenization_gpt2.py in _batch_encode_plus(self, *args, **kwargs)
    385         )
    386 
--> 387         return super()._batch_encode_plus(*args, **kwargs)
    388 
    389     def _encode_plus(self, *args, **kwargs) -> BatchEncoding:

/opt/conda/lib/python3.7/site-packages/transformers/tokenization_utils_fast.py in _batch_encode_plus(self, batch_text_or_text_pairs, add_special_tokens, padding_strategy, truncation_strategy, max_length, stride, is_pretokenized, pad_to_multiple_of, return_tensors, return_token_type_ids, return_attention_mask, return_overflowing_tokens, return_special_tokens_mask, return_offsets_mapping, return_length, verbose, **kwargs)
    378         else:
    379             encodings = self._tokenizer.encode_batch(
--> 380                 batch_text_or_text_pairs, add_special_tokens=add_special_tokens, is_pretokenized=is_pretokenized
    381             )
    382 

/opt/conda/lib/python3.7/site-packages/tokenizers/implementations/base_tokenizer.py in encode_batch(self, inputs, is_pretokenized, add_special_tokens)
    247             raise ValueError("encode_batch: `inputs` can't be `None`")
    248 
--> 249         return self._tokenizer.encode_batch(inputs, is_pretokenized, add_special_tokens)
    250 
    251     def decode(self, ids: List[int], skip_special_tokens: Optional[bool] = True) -> str:

Exception: Truncation error: Specified max length is too low to respect the various constraints
```


Comments:
@patrickvonplaten please see. if relevant 

Hi @manishiitg , can you post the command/code you used to run this example ? Won't be able to re-produce from the stack-trace.

Thanks for answering @patil-suraj . As @patil-suraj said, we need some code and also the environment info (it's empty above) to better answer here :-) 

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.