noamaanMulla-03/transformers-issues huggingface dataset:
missing "para" attribute in ARC dataset for multiple choice question answering model
Author: nrjvarshney
Pull request: no

# 🐛 Bug

## Information

Model I am using Roberta.

Language I am using the model on (English)

The problem arises when using:
* [ ] the official example scripts: (give details below)
**https://github.com/huggingface/transformers/blob/master/examples/utils_multiple_choice.py**

The tasks I am working on is:
* [ ] an official GLUE/SQUaD task: (give the name)
Multiple choice question answering

## To reproduce

Steps to reproduce the behavior:

1. run_multiple_choice.py 
with parameters as specified in the documentation replacing the task name to arc

In the data, there is no such parameter called "para"

contexts=[
                            options[0]["para"].replace("_", ""),
                            options[1]["para"].replace("_", ""),
                            options[2]["para"].replace("_", ""),
                            options[3]["para"].replace("_", ""),
                        ],


Comments:
Got it. 
This parameter is for the context.

May I know how do you solve this problem? I just ran into this problem.

You will have to add a "para" field for every choice - This is for adding knowledge. To get a baseline you can simply use a dummy text in that field 

`{
  "id": "MCAS_2000_4_6",
  "question": {
    "stem": "Which technology was developed most recently?",
    "choices": [
      {
        "text": "cellular telephone",
        "label": "A",
        "para": "fetched knowledge"
      },
      {
        "text": "television",
        "label": "B",
        "para": "fetched knowledge"
      },
      {
        "text": "refrigerator",
        "label": "C",
        "para": "fetched knowledge"
      },
      {
        "text": "airplane",
        "label": "D",
        "para": "fetched knowledge"
      }
    ]
  },
  "answerKey": "A"
}
`
Is there a classical transformer model in the project?
Author: 980202006
Pull request: no

Hi,
I am studying in some domain that need the original transformer which is from 《attention is what you all need》. Is there an implementation?

Comments:
You might find this useful http://nlp.seas.harvard.edu/2018/04/03/attention.html
I think PyTorch already have it implemented in their library
https://pytorch.org/docs/stable/nn.html?highlight=transformer#torch.nn.Transformer

thank you，It is a answer for me.
[Docs] Add DialoGPT
Author: patrickvonplaten
Pull request: yes

This PR adds DialoGPT to the model page and links the models on the model page https://github.com/huggingface/transformers#model-architectures to the docs.

Comments:
# [Codecov](https://codecov.io/gh/huggingface/transformers/pull/3755?src=pr&el=h1) Report
> Merging [#3755](https://codecov.io/gh/huggingface/transformers/pull/3755?src=pr&el=desc) into [master](https://codecov.io/gh/huggingface/transformers/commit/7972a4019f4bc9f85fd358f42249b90f9cd27c68&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/3755/graphs/tree.svg?width=650&height=150&src=pr&token=9qOlN6Hb1c)](https://codecov.io/gh/huggingface/transformers/pull/3755?src=pr&el=tree)

```diff
@@           Coverage Diff           @@
##           master    #3755   +/-   ##
=======================================
  Coverage   78.26%   78.26%           
=======================================
  Files         106      106           
  Lines       17928    17928           
=======================================
+ Hits        14031    14032    +1     
+ Misses       3897     3896    -1     
```


| [Impacted Files](https://codecov.io/gh/huggingface/transformers/pull/3755?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [src/transformers/modeling\_tf\_utils.py](https://codecov.io/gh/huggingface/transformers/pull/3755/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9tb2RlbGluZ190Zl91dGlscy5weQ==) | `92.96% <0.00%> (+0.16%)` | :arrow_up: |

------

[Continue to review full report at Codecov](https://codecov.io/gh/huggingface/transformers/pull/3755?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/3755?src=pr&el=footer). Last update [7972a40...c40ade1](https://codecov.io/gh/huggingface/transformers/pull/3755?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
AutoModel fails to load FlauBERT with `output_hidden_states`
Author: LoicGrobol
Pull request: no
Labels: name: wontfix

MWE:

```python
import transformers

model = transformers.AutoModel.from_pretrained("flaubert-base-cased", output_hidden_states=True)
```

Tested on rev 5a6b138 fails with

```console
Traceback (most recent call last):
  File "mwe.py", line 3, in <module>
    model = transformers.AutoModel.from_pretrained("flaubert-base-cased", output_hidden_states=True)
  File "<redacted>/transformers/modeling_auto.py", line 377, in from_pretrained
    return model_class.from_pretrained(pretrained_model_name_or_path, *model_args, config=config, **kwargs)
  File "<redacted>/transformers/modeling_utils.py", line 463, in from_pretrained
    model = cls(config, *model_args, **model_kwargs)
TypeError: __init__() got an unexpected keyword argument 'output_hidden_states'
```

This works when loading directly from `transformers.FlaubertModel`.

Comments:
Hi! the `output_hidden_states` should be specified in the configuration when loading from `AutoModel` classes. Doing the following is necessary to instantiate a class with hidden states:

```py
import transformers

config = transformers.AutoConfig.from_pretrained("flaubert-base-cased", output_hidden_states=True)
model = transformers.AutoModel.from_pretrained("flaubert-base-cased", config=config)
```

However, your issue showed me there was a bug with the loading of FlauBERT models with AutoModels, which I patched in https://github.com/huggingface/transformers/commit/ff6f1492e8296f511682fd56fcf62be0854723a2.
Please install from source to have the fix: `pip install git+https://github.com/huggingface/transformers`, I'll push a pypi patch for this soon.

Oh, okay, thanks. From what I understood of [AutoModel](https://huggingface.co/transformers/model_doc/auto.html#transformers.AutoModel.from_pretrained) doc, I thought all `**kwargs` in `AutoModel.from_pretrained` were passed to the config.

Indeed, the documentation seems misleading in that regard. I'm updating it.

`AutoTokenizer` seems to have the same problem as the one you fixed in `AutoModel`

```python
transformers.AutoTokenizer.from_pretrained("flaubert-base-uncased")
```

results in

```console
OSError: Model name 'flaubert-base-uncased' was not found in tokenizers model name list (xlm-mlm-en-2048, xlm-mlm-ende-1024, xlm-mlm-enfr-1024, xlm-mlm-enro-1024, xlm-mlm-tlm-xnli15-1024, xlm-mlm-xnli15-1024, xlm-clm-enfr-1024, xlm-clm-ende-1024, xlm-mlm-17-1280, xlm-mlm-100-1280)
```

Indeed it does, thanks @Evpok !

Should have been patched and tested with 1e82cd8.

Thanks for the quick response ♥

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.


I think this change should be bolder in documentations somehow as I had this problem too.
In just fouth blocks of the code of the colab notebook "01-training notebook", it just failed.
Author: AliceSum
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 -->
https://colab.research.google.com/drive/1gamxcO5AHioIHFVhTr1x71mn8SYPNkPz

`---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-4-559dbb5a1852> in <module>()
      7 
      8 # First we create an empty Byte-Pair Encoding model (i.e. not trained model)
----> 9 tokenizer = Tokenizer(BPE())
     10 
     11 # Then we enable lower-casing and unicode-normalization

TypeError: cannot create 'BPE' instances`

<!-- 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:
it seems to be that it can be solved by without installing it from pip

> it seems to be that it can be solved by without installing it from pip

could you please explain how you solved the issue ? did not understand.
thanks,

@uunal, do you have this issue too?

@JonathanSum yes, can not find a solution. Updated all packages, check dependency but still same error persists.

@uunal see the link above? If you don't want to waste your time, please feel free to use it, and it is the 01 training notebook. It has the solution. 

The solution applied: "it seems to be that it can be solved by without installing it from pip"

Ooh I get it now, pip version has a problem:) thanks

Anyways I found why it is not working with pip version, check out this commit:https://github.com/huggingface/transformers/commit/b7cf9f43d259fbad45d899c1769110aafc9f410a
Tokenizers Notebook  Issue
Author: uunal
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 -->

<!-- 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**: 

Hello everyone,
While playing around with tokenizers notebook : https://github.com/huggingface/transformers/blob/master/notebooks/01-training-tokenizers.ipynb

`---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
 in 
----> 1 tokenizer = Tokenizer(BPE()) # byte-pair encoding model
      2 # now using normalizers
      3 tokenizer.normalizer = Sequence([
      4     NFKC(),
      5     Lowercase()

TypeError: cannot create 'BPE' instances`

Could not find a resolution for this.  thanks

Comments:
pip version of installation has a problem, dependencies are not defined so it installs tokenizers-0.5.2 with transformers 2.8.0. 
Download from source and don't care warning of dependency, works fine :)
How to train BART text summarization with your own data?
Author: thedrowsywinger
Pull request: no

# ❓ Questions & Help

## Details
This is actually a two part question. I have noticed that in [1](https://github.com/huggingface/transformers/blob/master/examples/summarization/bart/run_train.sh) instructions have been given to train with the cnn/dm data. How would we train it with our own data? Should the file format be .story? 
And secondly how exactly do we handle the python path in google colab?

![image](https://user-images.githubusercontent.com/23182970/78650840-49d6a580-78e1-11ea-8796-d4267bf44714.png)

I have tried in both these ways and failed. 

Link to this question in SO: [2] (https://stackoverflow.com/questions/61058171/no-module-named-transformer-base/61070453#61070453)

Comments:
You can try to move transformer_base file to the same location of run_bart_sum.py.

Hi,
1.  As written in `README.md`
> "To use your own data, copy that files format. Each article to be summarized is on its own line."

 I think you should insert in cnn_dm folder your files renamed `train.source`, `train.target`, `test.source`, `test.target`, `val.source`, `val.target`, where in each file you have respectively a source text and a target text per line.

2. You are not using the script  `run_train.sh`, as suggested in the `README.md`. In the `run_train.sh` there are a series of export commands that you missed. 
The last one should fix your issue.
Hope it helps.

 ```export OUTPUT_DIR_NAME=bart_sum
export CURRENT_DIR=${PWD}
export OUTPUT_DIR=${CURRENT_DIR}/${OUTPUT_DIR_NAME}

# Make output directory if it doesn't exist
mkdir -p $OUTPUT_DIR

#Add parent directory to python path to access transformer_base.py
export PYTHONPATH="../../":"${PYTHONPATH}"```



Closing, @teelinsan 's answer is correct.
JIT not compatible with PyTorch/XLA
Author: LysandreJik
Pull request: yes

Tracing with JIT is not supported by TPUs. If `torch_xla` is detected in the environment, the `gelu_new` method won't be traced.

If tracing is done, the line:

```py
model = xm.send_cpu_data_to_device(model, xm.xla_device())
```
in `modeling_utils.py`

will raise:

```py
TypeError: can't pickle torch._C.ScriptFunction objects
```


the `# noqa F401` is necessary, otherwise, flake8 gives the following error:
```
src/transformers/activations.py:37:9: F401 'torch_xla' imported but unused
```

Comments:
cc @jysohn23
ModuleNotFoundError: No module named '__main__.utils_summarization'; '__main__' is not a package
Author: stellaywu
Pull request: no
Labels: name: bertabs

# 🐛 Bug

## Information

I am using ./examples/summarization/bertabs/

`python run_summarization.py \
    --documents_dir $data_dir\
    --summaries_output_dir$output_dir \
    --no_cuda true \
    --batch_size 4 \
    --min_length 50 \
    --max_length 200 \
    --beam_size 5 \
    --alpha 0.95 \
    --block_trigram true
`
returns 
`ModuleNotFoundError: No module named '__main__.utils_summarization'; '__main__' is not a package`

My environment
- `transformers` version: 2.8.0
- Platform: Darwin-18.7.0-x86_64-i386-64bit
- Python version: 3.7.3
- PyTorch version (GPU?): 1.1.0 (False)
- Tensorflow version (GPU?): 2.0.0-beta1 (False)
- Using GPU in script?: No
- Using distributed or parallel set-up in script?: No


Thank you!



Comments:
closing the issue 
changed the from `.utils_summarization import ( `
to ` from utils_summarization import ( `
in run_summarization.py
and solved the issue
Fix examples/translation/t5 to use newstest2014 rather than newstest2013
Author: tholiao
Pull request: yes

Resolves #3759, in addition to minor nits: fixed a bug with argparse arguments + more pythonic file handling + formatted with black and isort. 

Please note that I have not yet run the evaluation script against the full newstest2014 test set, as it is rather compute intensive, so the disclaimer at the top of the README.md about the score gap between the pre-trained and fine-tuned models is only ostensibly accurate to the score gap on newstest2013, not newstest2014.

Comments:
Hey @tholiao, 

Thanks a lot for the PR :-) This looks good so far. Don't worry about running the script against the evaluation set - we can do this once this is merged! 

Can you make sure that the `run_examples_torch` pass? Don't worry too much about the `check_code_quality` test - there have been some issues with `isort` and I can manually fix that later. 

Should be fine now. 

Hi @tholiao, I went into your PR branch and checked the `make style` issues. It seems like you have other params set up for `black` than this lib. Also `isort` seems to have some problems with the imports here. 

I added the tiny changes, I suggested above and correctly formatted everything (black and isort) in this PR https://github.com/huggingface/transformers/pull/3817. The PR uses your commits, so you are an author of the commit :-)
Tanh torch warnings
Author: aryanshomray
Pull request: yes

This pull request the warning generated by using torch.nn.functional.tanh (which is deprecated). This pull request changes it to torch.tanh to remove the warning.

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

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

```diff
@@           Coverage Diff           @@
##           master    #3828   +/-   ##
=======================================
  Coverage   78.47%   78.47%           
=======================================
  Files         106      106           
  Lines       17924    17924           
=======================================
  Hits        14066    14066           
  Misses       3858     3858           
```


| [Impacted Files](https://codecov.io/gh/huggingface/transformers/pull/3828?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [src/transformers/activations.py](https://codecov.io/gh/huggingface/transformers/pull/3828/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9hY3RpdmF0aW9ucy5weQ==) | `82.35% <ø> (ø)` | |

------

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


LGTM
typo: fine-grained token-leven
Author: AliceSum
Pull request: yes

Changing from "fine-grained token-leven" to "fine-grained token-level"

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

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

```diff
@@           Coverage Diff           @@
##           master    #3808   +/-   ##
=======================================
  Coverage   78.27%   78.27%           
=======================================
  Files         106      106           
  Lines       17964    17964           
=======================================
  Hits        14061    14061           
  Misses       3903     3903           
```



------

[Continue to review full report at Codecov](https://codecov.io/gh/huggingface/transformers/pull/3808?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/3808?src=pr&el=footer). Last update [301bf8d...7a12e87](https://codecov.io/gh/huggingface/transformers/pull/3808?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
T5 prediction using fine-tuned model
Author: prabalbansal
Pull request: no

After fine-tuning the T5 model on my own dataset, when I use the fine-tuned model to predict for test set using the following command:

python '/content/transformers-master/examples/summarization/bart/run_bart_sum.py' --data_dir='/content/drive/My Drive/two_keywords/' --model_type=t5 --output_dir=/content/t5 --do_predict --model_name_or_path=t5-small
Error generated: 
<img width="1010" alt="Screenshot 2020-04-13 at 6 18 47 PM" src="https://user-images.githubusercontent.com/30004110/79394604-31692980-7f78-11ea-8c87-3c04e542e962.png">

# ❓ 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 -->

<!-- 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:
@sshleifer @patrickvonplaten 

Hi, I am curious about how you fine-tined T5. Did you used the run_bart_sum.py script by changing the model type from bart to T5? Thanks!

@sshleifer - could you take a look at this if you find some time? `T5` should more or less work out-of-the-box with the `run_bart_sum` script no? 

@MichaelZhouwang yes. Please look at this. #3576