noamaanMulla-03/transformers-issues huggingface dataset:
Bert Abs not using GPU
Author: MichaelJanz
Pull request: no

# 🐛 Bug

## Information

Model I am using: Bert abs (https://github.com/huggingface/transformers/tree/master/examples/seq2seq/bertabs)
-> remi/bertabs-finetuned-cnndm-extractive-abstractive-summarization model

Language I am using the model on: English

The problem arises when using:
* [x] the official example 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

Steps to reproduce the behavior:

1. Install Conda Environment with proper pytorch installation
2. Verify that `torch.cuda.is_available()` return True
3. Start run_summarization.py as stated in the Readme

## Expected behavior

I would expect, that the models uses GPU for Training / Generation. Instead I have a very high CPU usage, Gpu usage is nearly zero and GPU clock stays idle. Since I verified that the GPU and cuda is available, I expect it to use it.

--no_cuda is not set, so the default of False is taken used

## Environment info

- `transformers` version: 2.11.0
- Platform: Windows-10-10.0.18362-SP0
- Python version: 3.7.7
- PyTorch version (GPU?): 1.5.1 (True)
- Tensorflow version (GPU?): not installed (NA)
- Using GPU in script?: Yes
- Using distributed or parallel set-up in script?: No



Comments:
This can be resolved by not using the remi/bertabs-finetuned-cnndm-extractive-abstractive-summarization model but the https://huggingface.co/remi/bertabs-finetuned-extractive-abstractive-summarization. With cnndm prefix I would expect it as a gpu version, but the opposite is the case.
Changing the model fixes the error
The start and end position of BertForQuestionAnswering
Author: hi-weiyuan
Pull request: no

# ❓ 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 am confused with the start and end position of Bert for QA model because of wordpiece. My question is: what is the value of position based on? For example, if start_position=10, it means the 10th word of the input or the 10th subword of input after wordpiece? Also, is the position value contains the length of question?
<!-- You should first ask your question on SO, and only if
     you didn't get an answer ask it here on GitHub. -->
**A link to original question on Stack Overflow**:


Comments:
The position is based on the tokens. So this means that if you have a context: 

"The dog runs in the park." and a question "Who runs in the park?" and the corresponding tokens (=`tokenizer("Who runs in the park?", "The dog runs in the park.",).input_ids`) are 

`[101, 2040, 3216, 1999, 1996, 2380, 1029, 102, 1996, 3899, 3216, 1999, 1996, 2380, 1012, 102]`, then the model will tell you at what start and end position **of the input_ids** the answer to the question will be located. To better understand how to correctly use QA you might want to take a look at the example under this model in the docs: https://huggingface.co/transformers/master/model_doc/bert.html#bertforquestionanswering
[Benchmarks] improve Example Plotter
Author: patrickvonplaten
Pull request: yes

This PR make it possible to plot csv files that have "N/A" values.

Comments:
# [Codecov](https://codecov.io/gh/huggingface/transformers/pull/5245?src=pr&el=h1) Report
> Merging [#5245](https://codecov.io/gh/huggingface/transformers/pull/5245?src=pr&el=desc) into [master](https://codecov.io/gh/huggingface/transformers/commit/9fe09cec76efa1e221c3fd6eb8520ba0a911f092&el=desc) will **decrease** coverage by `0.00%`.
> The diff coverage is `n/a`.

[![Impacted file tree graph](https://codecov.io/gh/huggingface/transformers/pull/5245/graphs/tree.svg?width=650&height=150&src=pr&token=9qOlN6Hb1c)](https://codecov.io/gh/huggingface/transformers/pull/5245?src=pr&el=tree)

```diff
@@            Coverage Diff             @@
##           master    #5245      +/-   ##
==========================================
- Coverage   77.93%   77.92%   -0.01%     
==========================================
  Files         138      138              
  Lines       23860    23859       -1     
==========================================
- Hits        18595    18593       -2     
- Misses       5265     5266       +1     
```


| [Impacted Files](https://codecov.io/gh/huggingface/transformers/pull/5245?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [src/transformers/benchmark/benchmark\_args\_utils.py](https://codecov.io/gh/huggingface/transformers/pull/5245/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9iZW5jaG1hcmsvYmVuY2htYXJrX2FyZ3NfdXRpbHMucHk=) | `89.13% <ø> (-0.24%)` | :arrow_down: |
| [src/transformers/modeling\_tf\_utils.py](https://codecov.io/gh/huggingface/transformers/pull/5245/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9tb2RlbGluZ190Zl91dGlscy5weQ==) | `86.00% <0.00%> (-0.15%)` | :arrow_down: |

------

[Continue to review full report at Codecov](https://codecov.io/gh/huggingface/transformers/pull/5245?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/huggingface/transformers/pull/5245?src=pr&el=footer). Last update [9fe09ce...882b09d](https://codecov.io/gh/huggingface/transformers/pull/5245?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
Request for inclusion of PEGASUS for text summarization by Google.
Author: avacaondata
Pull request: no

# 🚀 Feature request

Google has recently released PEGASUS, a new model for text summarization: https://ai.googleblog.com/2020/06/pegasus-state-of-art-model-for.html. I think It would be interesting to have it included in Transformers library. The code and checkpoints are here: https://github.com/google-research/pegasus. This model seems to accomplish human-like summarization. 

Comments:
We are currently working on it as far as I know :-) @sshleifer 

Duplicate of #4918 , but yes it is WIP!
[Generation] fix docs for decoder_input_ids
Author: patrickvonplaten
Pull request: yes

Fix docs for decoder input ids.

Comments:
Pinging @sshleifer, @sgugger and @LysandreJik for notification.

# [Codecov](https://codecov.io/gh/huggingface/transformers/pull/5306?src=pr&el=h1) Report
> Merging [#5306](https://codecov.io/gh/huggingface/transformers/pull/5306?src=pr&el=desc) into [master](https://codecov.io/gh/huggingface/transformers/commit/135791e8ef12802ceb21a4abbb3a93f7da1bf390&el=desc) will **decrease** coverage by `0.84%`.
> The diff coverage is `n/a`.

[![Impacted file tree graph](https://codecov.io/gh/huggingface/transformers/pull/5306/graphs/tree.svg?width=650&height=150&src=pr&token=9qOlN6Hb1c)](https://codecov.io/gh/huggingface/transformers/pull/5306?src=pr&el=tree)

```diff
@@            Coverage Diff             @@
##           master    #5306      +/-   ##
==========================================
- Coverage   79.30%   78.45%   -0.85%     
==========================================
  Files         138      138              
  Lines       24283    24283              
==========================================
- Hits        19258    19052     -206     
- Misses       5025     5231     +206     
```


| [Impacted Files](https://codecov.io/gh/huggingface/transformers/pull/5306?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [src/transformers/modeling\_tf\_utils.py](https://codecov.io/gh/huggingface/transformers/pull/5306/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9tb2RlbGluZ190Zl91dGlscy5weQ==) | `87.77% <ø> (ø)` | |
| [src/transformers/modeling\_utils.py](https://codecov.io/gh/huggingface/transformers/pull/5306/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9tb2RlbGluZ191dGlscy5weQ==) | `91.26% <ø> (+0.12%)` | :arrow_up: |
| [src/transformers/modeling\_tf\_openai.py](https://codecov.io/gh/huggingface/transformers/pull/5306/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9tb2RlbGluZ190Zl9vcGVuYWkucHk=) | `20.78% <0.00%> (-74.20%)` | :arrow_down: |

------

[Continue to review full report at Codecov](https://codecov.io/gh/huggingface/transformers/pull/5306?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/huggingface/transformers/pull/5306?src=pr&el=footer). Last update [135791e...d4e9c3f](https://codecov.io/gh/huggingface/transformers/pull/5306?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
Create README.md
Author: krevas
Pull request: yes
Labels: name: model card

Create README.md for finance-koelectra-base-discriminator model

Comments:
# [Codecov](https://codecov.io/gh/huggingface/transformers/pull/5270?src=pr&el=h1) Report
> Merging [#5270](https://codecov.io/gh/huggingface/transformers/pull/5270?src=pr&el=desc) into [master](https://codecov.io/gh/huggingface/transformers/commit/0e1fce3c0129d05b65a83cdd89e8eadded553f2e&el=desc) will **decrease** coverage by `0.02%`.
> The diff coverage is `n/a`.

[![Impacted file tree graph](https://codecov.io/gh/huggingface/transformers/pull/5270/graphs/tree.svg?width=650&height=150&src=pr&token=9qOlN6Hb1c)](https://codecov.io/gh/huggingface/transformers/pull/5270?src=pr&el=tree)

```diff
@@            Coverage Diff             @@
##           master    #5270      +/-   ##
==========================================
- Coverage   79.11%   79.08%   -0.03%     
==========================================
  Files         138      138              
  Lines       24080    24080              
==========================================
- Hits        19050    19043       -7     
- Misses       5030     5037       +7     
```


| [Impacted Files](https://codecov.io/gh/huggingface/transformers/pull/5270?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [src/transformers/modeling\_openai.py](https://codecov.io/gh/huggingface/transformers/pull/5270/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9tb2RlbGluZ19vcGVuYWkucHk=) | `79.51% <0.00%> (-1.39%)` | :arrow_down: |
| [src/transformers/trainer.py](https://codecov.io/gh/huggingface/transformers/pull/5270/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy90cmFpbmVyLnB5) | `38.44% <0.00%> (-1.18%)` | :arrow_down: |
| [src/transformers/modeling\_tf\_utils.py](https://codecov.io/gh/huggingface/transformers/pull/5270/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9tb2RlbGluZ190Zl91dGlscy5weQ==) | `87.77% <0.00%> (ø)` | |
| [src/transformers/file\_utils.py](https://codecov.io/gh/huggingface/transformers/pull/5270/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9maWxlX3V0aWxzLnB5) | `77.18% <0.00%> (+0.76%)` | :arrow_up: |

------

[Continue to review full report at Codecov](https://codecov.io/gh/huggingface/transformers/pull/5270?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/huggingface/transformers/pull/5270?src=pr&el=footer). Last update [0e1fce3...67157e9](https://codecov.io/gh/huggingface/transformers/pull/5270?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
Add benchmark notebook
Author: patrickvonplaten
Pull request: yes

This PR adds a general notebook on how to use the Benchmark tools

Comments:
# [Codecov](https://codecov.io/gh/huggingface/transformers/pull/5312?src=pr&el=h1) Report
> Merging [#5312](https://codecov.io/gh/huggingface/transformers/pull/5312?src=pr&el=desc) into [master](https://codecov.io/gh/huggingface/transformers/commit/135791e8ef12802ceb21a4abbb3a93f7da1bf390&el=desc) will **not change** coverage.
> The diff coverage is `n/a`.

[![Impacted file tree graph](https://codecov.io/gh/huggingface/transformers/pull/5312/graphs/tree.svg?width=650&height=150&src=pr&token=9qOlN6Hb1c)](https://codecov.io/gh/huggingface/transformers/pull/5312?src=pr&el=tree)

```diff
@@           Coverage Diff           @@
##           master    #5312   +/-   ##
=======================================
  Coverage   79.30%   79.30%           
=======================================
  Files         138      138           
  Lines       24283    24283           
=======================================
  Hits        19258    19258           
  Misses       5025     5025           
```


| [Impacted Files](https://codecov.io/gh/huggingface/transformers/pull/5312?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [src/transformers/modeling\_tf\_utils.py](https://codecov.io/gh/huggingface/transformers/pull/5312/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9tb2RlbGluZ190Zl91dGlscy5weQ==) | `87.62% <0.00%> (-0.15%)` | :arrow_down: |
| [src/transformers/modeling\_transfo\_xl.py](https://codecov.io/gh/huggingface/transformers/pull/5312/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9tb2RlbGluZ190cmFuc2ZvX3hsLnB5) | `78.93% <0.00%> (+0.19%)` | :arrow_up: |

------

[Continue to review full report at Codecov](https://codecov.io/gh/huggingface/transformers/pull/5312?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/huggingface/transformers/pull/5312?src=pr&el=footer). Last update [135791e...487fa69](https://codecov.io/gh/huggingface/transformers/pull/5312?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
[pipelines] Change summarization default to distilbart-cnn-12-6
Author: sshleifer
Pull request: yes
Labels: name: Core: Pipeline

- Also adds an integration test that runs on GPU if available.
- Other pipelines could do the same if that would be helpful.

Comments:
CI Failure is spurious.

Could you please tell me in **distilbart-cnn-12-6** what does **12 & 6** stands for?

12 Encoder layers and 6 decoder layers I would suggest

Thank you Sir, @patrickvonplaten
[pl_examples] default warmup steps=0
Author: sshleifer
Pull request: yes


Comments:
# [Codecov](https://codecov.io/gh/huggingface/transformers/pull/5316?src=pr&el=h1) Report
> Merging [#5316](https://codecov.io/gh/huggingface/transformers/pull/5316?src=pr&el=desc) into [master](https://codecov.io/gh/huggingface/transformers/commit/79a82cc06aaa68088639bf9bb000752cfd33a8c6&el=desc) will **increase** coverage by `0.00%`.
> The diff coverage is `n/a`.

[![Impacted file tree graph](https://codecov.io/gh/huggingface/transformers/pull/5316/graphs/tree.svg?width=650&height=150&src=pr&token=9qOlN6Hb1c)](https://codecov.io/gh/huggingface/transformers/pull/5316?src=pr&el=tree)

```diff
@@           Coverage Diff           @@
##           master    #5316   +/-   ##
=======================================
  Coverage   79.29%   79.30%           
=======================================
  Files         138      138           
  Lines       24282    24282           
=======================================
+ Hits        19254    19256    +2     
+ Misses       5028     5026    -2     
```


| [Impacted Files](https://codecov.io/gh/huggingface/transformers/pull/5316?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [src/transformers/modeling\_utils.py](https://codecov.io/gh/huggingface/transformers/pull/5316/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9tb2RlbGluZ191dGlscy5weQ==) | `91.14% <0.00%> (-0.13%)` | :arrow_down: |
| [src/transformers/file\_utils.py](https://codecov.io/gh/huggingface/transformers/pull/5316/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9maWxlX3V0aWxzLnB5) | `79.59% <0.00%> (+0.33%)` | :arrow_up: |
| [src/transformers/modeling\_tf\_pytorch\_utils.py](https://codecov.io/gh/huggingface/transformers/pull/5316/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9tb2RlbGluZ190Zl9weXRvcmNoX3V0aWxzLnB5) | `89.30% <0.00%> (+1.25%)` | :arrow_up: |

------

[Continue to review full report at Codecov](https://codecov.io/gh/huggingface/transformers/pull/5316?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/huggingface/transformers/pull/5316?src=pr&el=footer). Last update [79a82cc...ee4cc93](https://codecov.io/gh/huggingface/transformers/pull/5316?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
overflowing tokens are now always returned
Author: LysandreJik
Pull request: yes

closes https://github.com/huggingface/transformers/issues/5293

@thomwolf may be superseded by https://github.com/huggingface/transformers/pull/5308/files

Comments:
# [Codecov](https://codecov.io/gh/huggingface/transformers/pull/5310?src=pr&el=h1) Report
> Merging [#5310](https://codecov.io/gh/huggingface/transformers/pull/5310?src=pr&el=desc) into [master](https://codecov.io/gh/huggingface/transformers/commit/79a82cc06aaa68088639bf9bb000752cfd33a8c6&el=desc) will **increase** coverage by `0.00%`.
> The diff coverage is `0.00%`.

[![Impacted file tree graph](https://codecov.io/gh/huggingface/transformers/pull/5310/graphs/tree.svg?width=650&height=150&src=pr&token=9qOlN6Hb1c)](https://codecov.io/gh/huggingface/transformers/pull/5310?src=pr&el=tree)

```diff
@@           Coverage Diff           @@
##           master    #5310   +/-   ##
=======================================
  Coverage   79.29%   79.30%           
=======================================
  Files         138      138           
  Lines       24282    24282           
=======================================
+ Hits        19254    19256    +2     
+ Misses       5028     5026    -2     
```


| [Impacted Files](https://codecov.io/gh/huggingface/transformers/pull/5310?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [src/transformers/data/processors/squad.py](https://codecov.io/gh/huggingface/transformers/pull/5310/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9kYXRhL3Byb2Nlc3NvcnMvc3F1YWQucHk=) | `28.66% <0.00%> (ø)` | |
| [src/transformers/modeling\_utils.py](https://codecov.io/gh/huggingface/transformers/pull/5310/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9tb2RlbGluZ191dGlscy5weQ==) | `91.14% <0.00%> (-0.13%)` | :arrow_down: |
| [src/transformers/file\_utils.py](https://codecov.io/gh/huggingface/transformers/pull/5310/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9maWxlX3V0aWxzLnB5) | `79.59% <0.00%> (+0.33%)` | :arrow_up: |
| [src/transformers/modeling\_tf\_pytorch\_utils.py](https://codecov.io/gh/huggingface/transformers/pull/5310/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9tb2RlbGluZ190Zl9weXRvcmNoX3V0aWxzLnB5) | `89.30% <0.00%> (+1.25%)` | :arrow_up: |

------

[Continue to review full report at Codecov](https://codecov.io/gh/huggingface/transformers/pull/5310?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/huggingface/transformers/pull/5310?src=pr&el=footer). Last update [79a82cc...5583df5](https://codecov.io/gh/huggingface/transformers/pull/5310?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).


Yes, it's in #5308 :-)
lowercasing on LM with cased models
Author: boxorange
Pull request: no
Labels: name: wontfix

# 🐛 Bug

## Information

Model I am using (Bert, XLNet ...): Bert

Language I am using the model on (English, Chinese ...): English

The problem arises when using:
* [x] the official example scripts: (give details below)
* [ ] 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

Steps to reproduce the behavior:

1. Execute 'run_language_modeling.py' with one of the following cased models.
   (example of cased models: sciBert cased, BioBert, ClinicalBert)
2. Check the tokenizer's do_lower_case option.

## Expected behavior

I'm language modeling with my own data on the top of a pre-trained model. I'm using cased models, but the tokenizer lower case input data since its default lowercase option is True. When I used 'bert-base-cased', the tokenizer didn't lower case, but it happened with other cased models mentioned above. 
- tokens with 'bert-base-cased' model
['[CLS]', 'This', 'text', 'is', 'included', 'to', 'make', 'sure', 'Uni', '##code',...
- tokens with 'scibert_scivocab_cased' model
['[CLS]', 'this', 'text', 'is', 'included', 'to', 'make', 'sure', 'unic', '##ode',...

Is it a bug? or am I missing something?

As an alternative, I'm using a workaround code by adding additional command parameter.
```python
parser.add_argument("--do_lower_case", action="store_true", help="Should be added for uncased models.")

tokenizer = AutoTokenizer.from_pretrained(args.model_name_or_path, cache_dir=args.cache_dir, do_lower_case=args.do_lower_case)
```



Thanks in advance.


Comments:
Unfortunately, this is because these models didn't get uploaded with the `tokenizer_config.json` specifying they shouldn't be lowercased.

cc @julien-c 

I see. Thanks for the explanation. I think it would be helpful to mention that in the instruction or somewhere for newbies like me though. They may overlook it unless they actually test a model before training it.

Yes, if those models really are lowercase, we should add a `tokenizer_config.json` (and let their authors/uploaders know about it). Also cc @patrickvonplaten 

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.
Simplify LearnedPositionalEmbedding
Author: sshleifer
Pull request: no
Labels: name: cleanup

name: work in progress

`create_position_ids_from_input_ids` and `LearnedPositionalEmbedding` 
were both copied from fairseq and need either much more documentation or much simpler logic. They were originally copied for Roberta and now are also used for bart.

Comments:
Tokenizer could accept a string tensor
Author: celsofranssa
Pull request: no
Labels: name: wontfix

Currently, the [`batch_encode_plus`](https://huggingface.co/transformers/main_classes/tokenizer.html#transformers.PreTrainedTokenizer.batch_encode_plus) method from tokenizer, can return a Tensorflow tensor. 
It can be done assigning `tf` to the optional parameter `return_tensors`.

It would be great if this method also accepted a Tensorflow string tensor in parameter ` batch_text_or_text_pairs`.


For instance, if someone has the following `sample_string_tensor`:

```python
import tensorflow as tf

batch_size = 4
sample_string_tensor = tf.convert_to_tensor(
["sãmple utf-8 stríng - " + str(i) for i in range(n_strings)]
)

# <tf.Tensor: shape=(4,), dtype=string, numpy=
# array([b's\xc3\xa3mple utf-8 str\xc3\xadng - 0',
#        b's\xc3\xa3mple utf-8 str\xc3\xadng - 1',
#        b's\xc3\xa3mple utf-8 str\xc3\xadng - 2',
#        b's\xc3\xa3mple utf-8 str\xc3\xadng - 3'], dtype=object)>
```
the tokenization would be as simple as:
```python
tokenized_sample = tokenizer.batch_encode_plus(
    sample_string_tensor, 
    max_length=max_length, 
    pad_to_max_length=True, 
    return_tensors="tf"
)
```

Comments:
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.