noamaanMulla-03/transformers-issues huggingface dataset:
[ci] skip doc jobs - circleCI is not reliable - disable skip for now
Author: stas00
Pull request: yes

We can't do reliable skipping if we can't get a reliable range of changes and cirlcleCI is all over
e.g. in this PR https://github.com/huggingface/transformers/pull/8918 it changed `pipeline.git.base_revision` **on every commit** resulting only the changes from last commit appearing as a change for the whole PR, which is very bad, since the PR could be failing tests, but the last commit's changes in doc file only will make it appear that everything is green, which could be very misleading.

I wasn't able to reproduce this yet another edge case (see attempts below), but we clearly have that happened in #8918

So this PR disables the magic until I hope I get a solution from circleCI devs which we are discussing via their support.

I'm leaving the printouts in place to continue diagnosing the issue.

It could also be that we won't be able to do that if we don't find a reliable to way to get such a simple information from circleCI, then I will remove it completely.

Thank you for bearing with me, as this is a nice-to-have but not an essential feature.

@LysandreJik, @sgugger 

Comments:
Thanks for investigating this!

The thread discussing getting a reliable range of changes on CircleCI is here:
https://discuss.circleci.com/t/pipeline-git-base-revision-is-completely-unreliable/38301
Add functioning early stopping (patience) and weighted random sampling
Author: Breakend
Pull request: yes
Labels: name: wontfix

This is to fix the issues in #4186 (hopefully) to get it merged in. Also adds weighted random sampling for imbalanced classes.

Comments:
# [Codecov](https://codecov.io/gh/huggingface/transformers/pull/5958?src=pr&el=h1) Report
> Merging [#5958](https://codecov.io/gh/huggingface/transformers/pull/5958?src=pr&el=desc) into [master](https://codecov.io/gh/huggingface/transformers/commit/09a2f40684f77e62d0fd8485fe9d2d610390453f&el=desc) will **decrease** coverage by `0.09%`.
> The diff coverage is `13.04%`.

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

```diff
@@            Coverage Diff             @@
##           master    #5958      +/-   ##
==========================================
- Coverage   78.49%   78.39%   -0.10%     
==========================================
  Files         146      146              
  Lines       26210    26252      +42     
==========================================
+ Hits        20573    20580       +7     
- Misses       5637     5672      +35     
```


| [Impacted Files](https://codecov.io/gh/huggingface/transformers/pull/5958?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [src/transformers/trainer.py](https://codecov.io/gh/huggingface/transformers/pull/5958/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy90cmFpbmVyLnB5) | `35.50% <9.09%> (-2.34%)` | :arrow_down: |
| [src/transformers/training\_args.py](https://codecov.io/gh/huggingface/transformers/pull/5958/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy90cmFpbmluZ19hcmdzLnB5) | `78.00% <100.00%> (+0.44%)` | :arrow_up: |
| [src/transformers/generation\_tf\_utils.py](https://codecov.io/gh/huggingface/transformers/pull/5958/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9nZW5lcmF0aW9uX3RmX3V0aWxzLnB5) | `86.46% <0.00%> (+0.25%)` | :arrow_up: |

------

[Continue to review full report at Codecov](https://codecov.io/gh/huggingface/transformers/pull/5958?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/5958?src=pr&el=footer). Last update [09a2f40...cbc7c63](https://codecov.io/gh/huggingface/transformers/pull/5958?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-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.


when this will be added to library?

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.
Getting underling S3 URL
Author: ghost
Pull request: no
Labels: name: wontfix

# ❓ 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 the Hugging Face forum: https://discuss.huggingface.co/ .
     You can also try Stack Overflow (SO) where a whole community of PyTorch and
     Tensorflow enthusiast can help you out. In this case, 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 
     -->

## Details
The high performance cluster environment at my work has been great for working with transformers. The downside however is that most access to the internet has been locked down. This means that I have been manually bringing in the models. This is somewhat problematic since it is a laborious process and I have been behind on being able to update to the newest models. 

The IT team has however said that they would be able to white list a specific S3 bucket. When I see the link to the models, I see that it is of the form: https://s3.amazonaws.com/models.huggingface.co rather than the usual https://bucket-name.s3.Region.amazonaws.com.

Is there any chance I could obtain that second format for the bucket?



Comments:
probably @julien-c can help here

By default the library actually downloads model weights from `cdn.huggingface.co` so you might want to whitelist that domain.

For config files, we do download from S3. You can check the urls in the model pages' file lists e.g. https://huggingface.co/bert-base-multilingual-cased#list-files

and then replace the prefix:
`https://s3.amazonaws.com/models.huggingface.co/`
by
`http://models.huggingface.co.s3.amazonaws.com/`


I experienced this problem and have found at least one cause to it. I added a print to the library to print what URL it was actually fetching. curl-ing that URL was no problem, but from within the package, I got a different response. I then discovered that I was able to run as root with sudo. I then straced with both my regular user and my root user and diffed the results. Then i figured out that my regular user had a .netrc-file in the home directory. Renaming that fixed the issue for me. Only took 7 hours :-\

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.
How to train a model based on CTRL
Author: nooralahzadeh
Pull request: no
Labels: name: wontfix

# ❓ Questions & Help
I am wondering how to train A Conditional Transformer Language Model for Controllable Generation (CTRL)?
Thanks
<!-- 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 the Hugging Face forum: https://discuss.huggingface.co/ .
     You can also try Stack Overflow (SO) where a whole community of PyTorch and
     Tensorflow enthusiast can help you out. In this case, 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 
     -->

## Details
<!-- Description of your issue -->
I saw that there is a code for text generation based on CTRL, but did not find any for the training phase!
<!-- You should first ask your question on the forum or SO, and only if
     you didn't get an answer ask it here on GitHub. -->
**A link to original question on the forum/Stack Overflow**:

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.
Error: isTensor() INTERNAL ASSERT FAILED from traced RoBERTa model on iOS using LibTorch
Author: jbmaxwell
Pull request: no
Labels: name: wontfix

I've exported RoBERTa from a traced model for running on iOS using LibTorch and I'm getting this error when running prediction in the app: `isTensor() INTERNAL ASSERT FAILED at /Users/distiller/project/aten/src/ATen/core/ivalue_inl.h:86, please report a bug to PyTorch. Expected Tensor but got Tuple (toTensor at /Users/distiller/project/aten/src/ATen/core/ivalue_inl.h:86)`. I'm using the BertTokenizer because I have a small, fixed vocabulary (not natural language), and found It easier to use this vocabulary with the Bert tokenizer (happy to be corrected on this). I can train and test the model without issue in Python.
     
My conversion code is as follows (it's very possible I've done something wrong here!):

```
tokenizer = BertTokenizer('./data/vocab.txt')

config = RobertaConfig(
    vocab_size=858,
    max_position_embeddings=258,
    num_attention_heads=6,
    num_hidden_layers=4,
    type_vocab_size=1,
    torchscript=True
)

model = RobertaForMaskedLM(config=config).from_pretrained('./trained_RoBERTa')
model.cpu()
model.eval()

example_input = torch.LongTensor(1, 256).random_(0, 857).cpu()
traced_model = torch.jit.trace(model, example_input)
traced_model.save('./exports/trained_RoBERTa.pt')
```

Transformers version: 3.2.0
Ubuntu 18.04
Python 3.7.2
PyTorch 1.5
Cuda 10.2

I should mention that if there's a relatively painless path to using CoreML instead of LibTorch I'd love to hear about it.

Comments:
Ack! The error was actually in my Obj-C++ code, which had `auto outputTensor = _impl.forward({tensor}).toTensor();`... that will have to become `auto outputTuple = _impl.forward({tensor}).toTuple();`. Apologies for the spam, but hopefully this helps someone else some day. I found the hint here: https://github.com/pytorch/pytorch/issues/32039#issuecomment-573167212

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.
Cuda out of memory when fp16 training
Author: kotinigor
Pull request: no
Labels: name: wontfix

# ❓ Questions & Help
I have error when run train with fp16
<!-- 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 the Hugging Face forum: https://discuss.huggingface.co/ .
     You can also try Stack Overflow (SO) where a whole community of PyTorch and
     Tensorflow enthusiast can help you out. In this case, 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 
     -->

## Details
<!-- Description of your issue -->
I want to train Albert model on Russian. I use run_language_modeling.py with some changes in dataset creating. If i run training with fp32 (without --fp flag) and batch_size=2, I will ok. But if i run training with --fp16 flag, i will obtain cuda out of memory error. I tried to decdeare batch size to 1, however, I obtained same error.


Comments:
Same issue when running distilbart

I face the same issue with PEGASUS

I've run into this with several seq2seq models (Pegasus, BART, T5). Ironically, running with fp16 causes increased GPU memory usage.

I solved my issue by downgrading Pytorch to 1.5.1 and installing Nvidia/Apex. 

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.
(GPT2) Running out of GPU memory(24G) on WSL2 but not on native linux.
Author: Sheraf1
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: WSL2 Debian 
- Python version: 3.7
- PyTorch version (GPU?): 1.3.1
- 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 
 Trainer: @sgugger
 Speed and Memory Benchmarks: @patrickvonplaten
 TextGeneration: @TevenLeScao 
 -->

## Information

Model I am using (Bert, XLNet ...): GPT2

The problem arises when using:
the official example scripts: (give details below)
I'm running the run_language_modeling.py trying to finetune GPT-2

----
On WSL2 i Run out of memory:

```RuntimeError: CUDA out of memory. Tried to allocate 384.00 MiB (GPU 0; 24.00 GiB total capacity; 22.01 GiB already allocated; 342.71 MiB free; 65.09 MiB cached)```

but if i boot a live ubuntu and run the exact same script it works fine.

I'm using all default settings just as in the example doc.

not sure what is it due to and how to fix it?


Comments:
I can train the bert-base-multilingual-cased model and its taking almost all my memory (21109MiB / 24576MiB) on WSL2 meanwhile only taking about 8G on native linux..



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.
can i self-define the decoder when i user EncoderDecoderModel?
Author: lonelydancer
Pull request: no
Labels: name: wontfix

# ❓ Questions & Help
In my task, i have to define a decoder by myself, because the vocabulary is Chinese words.
But it seems the class method do not support that, i have to init the decoder from the pretrained model.

<!-- 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 the Hugging Face forum: https://discuss.huggingface.co/ .
     You can also try Stack Overflow (SO) where a whole community of PyTorch and
     Tensorflow enthusiast can help you out. In this case, 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 
     -->

## Details
<!-- Description of your issue -->

<!-- You should first ask your question on the forum or SO, and only if
     you didn't get an answer ask it here on GitHub. -->
**A link to original question on the forum/Stack Overflow**:

Comments:
Hey @lonelydancer, 

you can define which decoder you want to use. It can be either a pretrained model or a randomly initialized model. The model just has to be part of `AutoModelForCausalLM` to be loaded into the EncoderDecoderModel. If you give me some more details on your use-case I can probably help you :-) 

@patrickvonplaten 
Hi,here is my code.It seems ok.

tokenizer = BertTokenizer.from_pretrained(model_name)
tokenizer.bos_token = tokenizer.cls_token
tokenizer2 = BertTokenizer(vocab_file=voc_file, tokenize_chinese_chars=False) # Initialize tokenizer use my own vocab
tokenizer2.bos_token = tokenizer2.cls_token
decoder_model =  AutoModelForCausalLM.from_config(config=decoder_config)
config = EncoderDecoderConfig.from_encoder_decoder_configs(encoder_config, decoder_config)



Why would you need two tokenizers ? 
Should the model encode in English and decode to Chinese?

@patrickvonplaten  inmy task，encoder model tokenizer is char level， and the decoder model is a word sequence.

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.
Load Pre-Trained Model Using Docker
Author: idhasson
Pull request: no
Labels: name: wontfix

# ❓ 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 the Hugging Face forum: https://discuss.huggingface.co/ .
     You can also try Stack Overflow (SO) where a whole community of PyTorch and
     Tensorflow enthusiast can help you out. In this case, 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 
     -->

## Details
<!-- Description of your issue -->

<!-- You should first ask your question on the forum or SO, and only if
     you didn't get an answer ask it here on GitHub. -->
I'm trying to load a pre trained model using transformers lib (by hugging-face):

from transformers import GPT2Tokenizer, GPT2Model
tokenizer = GPT2Tokenizer.from_pretrained('gpt2-medium')

Using local machine, it starts to download the model. But with docker I get the following:

OSError: Model name 'gpt2-medium' was not found in tokenizers model 
name list (gpt2, gpt2-medium, gpt2-large, gpt2-xl, distilgpt2). We 
assumed 'gpt2-medium' was a path, a model identifier, or url to a 
directory containing vocabulary files named ['vocab.json', 
'merges.txt'] but couldn't find such vocabulary files at this path or url.

Any idea why it happens?

Comments:
Are you sure you have internet access on your machine? Can you do `wget https://s3.amazonaws.com/models.huggingface.co/bert/gpt2-medium-config.json`?

I have the same issue. The machine on which I am deploying the container to does have internet access, it can download other models from nltk / spacy

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.
Difference between tokenize chinese char
Author: wlhgtc
Pull request: no
Labels: name: wontfix

The function `BertTokenizer` has a parameter `tokenize_chinese_chars` and default True.
When I set it to false, I got different result as follows:
```
1. tokenize chinese char: ['任', '务']
2. not tokenize chinese char: ['任', '##务']
```
The code is as follows(and 任务 means task in English):

```
    vocab_file = './resources/robert/vocab.txt'
    bert_tokenizer1 = BertTokenizer(vocab_file, tokenize_chinese_chars=True)
    bert_tokenizer2 = BertTokenizer(vocab_file, tokenize_chinese_chars=False)
    text = '任务'
    res1 = bert_tokenizer1.tokenize(text)
    res2 = bert_tokenizer2.tokenize(text)
    print('tokenize chinese char:', res1)
    print('not tokenize chinese char:' ,res2)
```
If I use the default setting, I will get the first result. In that way, **the nearly half of vocab words will not used**(like  `'##务'`)! 
Cause we split all chinese char, it will not get `'任务'` in `WordpieceTokenizer`. It's wired.
Can somebody explain this setting for me ?

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.
Movement Pruning for GPT2
Author: snaik2016
Pull request: no
Labels: name: wontfix

# ❓ Questions & Help
Is it possible to make the movement pruning work for GPT2 model?
Principally it should work as it is, did anyone try it and can we have it in examples?

Thanks

<!-- 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 the Hugging Face forum: https://discuss.huggingface.co/ .
     You can also try Stack Overflow (SO) where a whole community of PyTorch and
     Tensorflow enthusiast can help you out. In this case, 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 
     -->

## Details
<!-- Description of your issue -->

<!-- You should first ask your question on the forum or SO, and only if
     you didn't get an answer ask it here on GitHub. -->
**A link to original question on the forum/Stack Overflow**:

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.
how to customize the position encoding
Author: FTD007
Pull request: no
Labels: name: wontfix

# ❓ 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 the Hugging Face forum: https://discuss.huggingface.co/ .
     You can also try Stack Overflow (SO) where a whole community of PyTorch and
     Tensorflow enthusiast can help you out. In this case, 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 
     -->

## Details
<!-- Description of your issue -->
I want to add in non sequence encoding to pre-train a model. Could anyone please point me where should I look at?

<!-- You should first ask your question on the forum or SO, and only if
     you didn't get an answer ask it here on GitHub. -->
**A link to original question on the forum/Stack Overflow**:

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.
Copyright date and owner not filled out in LICENSE file
Author: Meadosc
Pull request: no
Labels: name: wontfix

In transformers/LICENSE the copyright date and owner is not filled out.

https://github.com/huggingface/transformers/blob/master/LICENSE#L179-L190

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.


Thanks @Meadosc for raising this, we're not sure if this is a requirement of the license in order to add the copyright date and owner.

We only saw this issue now but think it would be good to reopen the issue (as it was auto-closed by the bot) to be addressed by the repository maintainers if possible!