noamaanMulla-03/transformers-issues huggingface dataset:
'Speech2TextProcessor' has no attribute 'from_pretrained'`
Author: Shiro-LK
Pull request: no

## 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: 4.6.1
- Platform: ubuntu
- Python version: 3.7.10
- PyTorch version (GPU?): cpu 1.8.1
- Tensorflow version (GPU?): no tensorflow
- Using GPU in script?: no cpu



Models:

Speech2TextProcessor

## To reproduce

Steps to reproduce the behavior:

1. processor =Speech2TextProcessor.from_pretrained("facebook/s2t-small-librispeech-asr")



The error I got : 

`AttributeError: type object 'Speech2TextProcessor' has no attribute 'from_pretrained'`

<!-- A clear and concise description of what you would expect to happen. -->

I don't understand why I got this issue because in processing_speech_to_text.py, line 78 "from_pretrained" exist.

Comments:
Hello! I'm fixing this in #12145 to return a better error.
Have dummy processors have a `from_pretrained` method
Author: LysandreJik
Pull request: yes

Fix https://github.com/huggingface/transformers/issues/12100

Before:

```py
>>> from transformers import Speech2TextProcessor
>>> processor =Speech2TextProcessor.from_pretrained("facebook/s2t-small-librispeech-asr")
```
```out
Traceback (most recent call last):
  File "<input>", line 1, in <module>
AttributeError: type object 'Speech2TextProcessor' has no attribute 'from_pretrained'
```

After:

```py
>>> from transformers import Speech2TextProcessor
>>> processor =Speech2TextProcessor.from_pretrained("facebook/s2t-small-librispeech-asr")
```
```out
Traceback (most recent call last):
  File "<input>", line 1, in <module>
  File "/home/lysandre/Workspaces/Python/transformers/src/transformers/utils/dummy_sentencepiece_and_speech_objects.py", line 11, in from_pretrained
    requires_backends(cls, ["sentencepiece", "speech"])
  File "/home/lysandre/Workspaces/Python/transformers/src/transformers/file_utils.py", line 606, in requires_backends
    raise ImportError("".join([BACKENDS_MAPPING[backend][1].format(name) for backend in backends]))
ImportError: 
Speech2TextProcessor requires the SentencePiece library but it was not found in your environment. Checkout the instructions on the
installation page of its repo: https://github.com/google/sentencepiece#installation and follow the ones
that match your environment.

Speech2TextProcessor requires the torchaudio library but it was not found in your environment. You can install it with pip:
`pip install torchaudio`


```

Comments:
Update conversion of Tatoeba marian models
Author: Traubert
Pull request: yes

# What does this PR do?

The Helsinki-NLP / Tatoeba NMT models have gone through various
architectural changes, and the old conversion code fails on them. This
commit is something of a rewrite to remedy this, in particular parsing
supplied yaml files rather than README.md files. It needs to be looked
at by someone on the Huggingface side.

## Before submitting
- [ ] This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
- [x] Did you read the [contributor guideline](https://github.com/huggingface/transformers/blob/master/CONTRIBUTING.md#start-contributing-pull-requests),
      Pull Request section?
- [ ] Was this discussed/approved via a Github issue or the [forum](https://discuss.huggingface.co/)? Please add a link
      to it if that's the case.
- [ ] Did you make sure to update the documentation with your changes? Here are the
      [documentation guidelines](https://github.com/huggingface/transformers/tree/master/docs), and
      [here are tips on formatting docstrings](https://github.com/huggingface/transformers/tree/master/docs#writing-source-documentation).
- [ ] Did you write any new necessary tests?


## Who can review?

@sgugger @sshleifer

Comments:
Oops, this PR depends on merging a pull request to Tatoeba which hasn't happened yet. Closing for now.
Add course banner
Author: sgugger
Pull request: yes

# What does this PR do?

This PR adds a course banner in the main README, looking like this:

![image](https://user-images.githubusercontent.com/35901082/122060415-90644180-cdbb-11eb-8db3-36823533e6fb.png)


Comments:
Merging so the image is online and I can then adjust the width if necessary.
Enable add_prefix_space on run_ner if necessary
Author: kumapo
Pull request: yes

# What does this PR do?

Enable add_prefix_space for a tokenizer on run_ner and run_ner_no_trainer if it needs to be instantiated with.

Fixes #9607


## Before submitting

- [ ] This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
- [x] Did you read the [contributor guideline](https://github.com/huggingface/transformers/blob/master/CONTRIBUTING.md#start-contributing-pull-requests),
      Pull Request section?
- [x] Was this discussed/approved via a Github issue or the [forum](https://discuss.huggingface.co/)? Please add a link
      to it if that's the case.
- [ ] Did you make sure to update the documentation with your changes? Here are the
      [documentation guidelines](https://github.com/huggingface/transformers/tree/master/docs), and
      [here are tips on formatting docstrings](https://github.com/huggingface/transformers/tree/master/docs#writing-source-documentation).
- [ ] Did you write any new necessary tests?


I've tested it:
```
% python -m pytest -n auto --dist=loadfile -s -v ./examples/ 
...
Results (256.02s):
      24 passed
      21 skipped
```

additionally checked style and quality then fixed it up:
```
% make style && make quality && make fixup                       
...
All done! ✨ 🍰 ✨
```

## Who can review?

Examples:

- maintained examples (not research project or legacy): @sgugger, @patil-suraj


Comments:
Thanks for your PR, but this is too complicated. The examples are just example, and should be modified by users directly for specific use-cases, we can't support everything out of the box.

@sgugger I agree with you it's somewhat complicated.

So, I've pushed codes that simplified as possible and also support for training roberta.

Actually I've experienced #9607 on training roberta for ner task.
Refering to #9607, only roberta-base and roberta-large have the issue. 
So, it's enough that run_ner supports roberta for now.

If you think it's still too complicated, I will close this pr and just use it for me.

Thank you for your suggestion!
Let me update the pr.

I've updated the pr.
@sgugger, please take a look through it.
Ray Tune Integration Updates
Author: amogkam
Pull request: yes

# What does this PR do?
- Automatically disables memory tracker if enabled since the memory tracker is not serializable
- Fixes the Ray Tune integration test
- Adds a new test for Ray Client API
- Adds integration tests back to the scheduled Github Actions pipeline

Closes #11249, https://github.com/huggingface/transformers/issues/12177 

@LysandreJik @richardliaw 


Comments:
thanks @sgugger for the fast review! anything blocking to get this merged :) ?

This is good for me. You had standing questions for Lysandre so not sure it was ready to be merged, but I will do so if you tell me everything is okay on your side :-)

@sgugger yep this is ready to merge!

Thanks again!
[testing] concurrent dist tests fail when using the same master_port
Author: stas00
Pull request: no

The failing `tests/extended/test_trainer_ext.py::TestTrainerExt::test_run_seq2seq_ddp` on multi-gpu slow runner happens because of concurrency of `-n 2` on push (it's `-n 1` on scheduled), so we end up with 2 dist tests running at the same time and clashing on ending up using the same default port used by `torch.distributed.launch`.  and the latter test failing with "Address already in Use".

I started a discussion at https://github.com/pytorch/pytorch/issues/59978 hoping to expose the `init_method=file://` through the CLI, but alas it won't help since the test suite needs to support the older pytorch even if it's exposed.

Furthermore, pytorch-1.9.1 or perhaps higher will have a different way using FileStore as a "rendezvous endpoint" in `torch.distributed.run` - a replacement for `torch.distributed.launch`.

Meanwhile it was proposed to use TorchElastic, which requires launching a server https://pytorch.org/elastic/0.2.2/quickstart.html before the test suite start and somehow ensuring it gets killed at the end. This looks very error-prone to me, especially when the test suite fails.

But I'm not yet sure how to come up with an algorithm to get the unique unused port to each test client, other than writing yet another server that will do the port management on demand.

@LysandreJik 


Comments:
Would it be helpful to extract the tests that use the same port with a custom decorator, and run them in a separate `run` directive with `-n 1`?

That is a possibility too, see the simple proposed solution https://github.com/huggingface/transformers/pull/12166 - perhaps to try first.
[testing] ensure concurrent pytest workers use a unique port for torch.dist
Author: stas00
Pull request: yes

As discussed at https://github.com/huggingface/transformers/issues/12164 currently concurrent tests may try to use the same port when running `-m torch.distributed.launch` and thus fail with `RuntimeError: Address already in use` error. This PR solves this problem by assigning a unique port to each worker when run under `pytest-xdist` with `-n 2` or higher.

It also adds 2 helper `testing_utils.py` functions:
- `pytest_xdist_worker_id`
- `get_torch_dist_unique_port`
to accomplish that.

Actually I'm not 100% sure that the original failure was caused by this problem, as it could be also caused by some run-away test that still holds the port. If this is the case I will work further on this helper function to actually test that the port it returns is free and will have to think of some extra solutions, because checking that the port is free and binding it is not atomic and there could be a race condition leading to the same problem.

But this is an important fix on its own as long as we plan to continue using pytest-xdist

Fixes: https://github.com/huggingface/transformers/issues/12164

@LysandreJik, @sgugger 

Comments:
Model card defaults
Author: sgugger
Pull request: yes

# What does this PR do?

This PR adds some better defaults to the auto-generated model cards for:
- the dataset names and tags
- the checkpoint it's fine-tuned from
- the type of task 

As an example, on the classic fine-tuning of bert using the Trainer on GLUE, this is what we get for the metadata without telling the Trainer anything:
```
---
license: apache-2.0
datasets:
- glue
metrics:
- accuracy
- f1

model-index:
- name: finetuned-bert
  results:
  - task:
      name: Text Classification
      type: text-classification
    dataset:
      name: glue
      type: glue
      args: mrpc
    metrics:
      - name: Accuracy
        type: accuracy
        value: 0.8431372549019608
      - name: F1
        type: f1
        value: 0.8915254237288135
---
```

As a side note, the implementation completes the worked begun for a file with the mapping of the auto model names (to avoid importing all models) in order to properly guess the class name.

Comments:
Hi @sgugger , really cool feature :+1: 

It would also be a good feature to distinguish between dev and test score :)

@LysandreJik yeah no let's not add it as it's not required

Will be easier to maintain a mapping on the hub's side if it's not (needlessly) overridden. cc @osanseviero cf. https://github.com/huggingface/huggingface_hub/pull/109 in "How is a model's type of inference API and widget determined?"
Allow setting permissions of downloaded models (via envvar)
Author: BramVanroy
Pull request: no
Labels: name: Feature request

In our research group we all have user accounts on a server where we each run our own experiments (Ubuntu behind the scenes). By default, everyone is downloading `transformers` models to their own home directory. Let's say we have 20 researchers, that might mean that we have 20 duplicates of "bert-base-cased" on the server (and of many other models). This is not efficient at all and takes too much room to our liking.

We have tried creating a 777 directory as TRANSFORMERS_CACHE globally, but that does not work. If I download a model, some of the downloaded files get a read/write access for me as the creator of the file. This means that others cannot use the model (permission denied).

Our suggestion or request would be to have an option when downloading a model to also set its permissions for all downloaded files. Preferably adjustable via a (system-wide) environment variable. This would probably need to be added in file_utils.py, similar to other options like "local_files_only". 

I currently do not have time to work on this myself, but I am open to any feedback of course.

Comments:
Would PR https://github.com/huggingface/transformers/pull/11119 help with your use-case?

> Would PR #11119 help with your use-case?

Indeed, thanks!
Tensorflow variant of DataCollatorForLanguageModeling.
Author: aromans
Pull request: yes

Co-authored-by: Dalton Walker <dalton_walker@icloud.com>

# What does this PR do?

We didn't see any support for TensorFlow within the DataCollatorForLanguageModeling data class. Integrating directly with TensorFlow seems useful for TensorFlow users and avoids the necessity for tensor conversion.

This PR adds a TFDataCollatorForLangaugeModeling data class that integrates directly with TensorFlow tensors and paves the way for further TFDataCollator conversions. 


## Before submitting

- [x] Did you read the [contributor guideline](https://github.com/huggingface/transformers/blob/master/CONTRIBUTING.md#start-contributing-pull-requests),
      Pull Request section?
- [ ] Was this discussed/approved via a Github issue or the [forum](https://discuss.huggingface.co/)? Please add a link
      to it if that's the case.
- [x] Did you make sure to update the documentation with your changes? Here are the
      [documentation guidelines](https://github.com/huggingface/transformers/tree/master/docs), and
      [here are tips on formatting docstrings](https://github.com/huggingface/transformers/tree/master/docs#writing-source-documentation).
- [x] Did you write any new necessary tests?


## Who can review?

@LysandreJik 

Anyone in the community is free to review the PR.


Comments:
Hello, it seems there are a lot of changes in your PR. If you think this isn't the case, do you mind closing this and opening a new PR so that we may see the correct diff? Also feel free to ping @Rocketknight1 and @sgugger for review

Will do! We had some issues with git but we can clean it up and resubmit.
Batched pipeline for NER
Author: dinani65
Pull request: no

Hi,

Is there a way to run batches with NER Pipeline rather than just one example?

Thanks.

Comments:
This has been asked many times before, see #11244. However, the corresponding PR was not merged, see [this comment](https://github.com/huggingface/transformers/pull/11251#pullrequestreview-637488364) for the reason.
Enabling AutoTokenizer for HubertConfig.
Author: Narsil
Pull request: yes

# What does this PR do?

<!--
Congratulations! You've made it this far! You're not quite done yet though.

Once merged, your PR is going to appear in the release notes with the title you set, so make sure it's a great title that fully reflects the extent of your awesome contribution.

Then, please replace this with a description of the change and which issue is fixed (if applicable). Please also include relevant motivation and context. List any dependencies (if any) that are required for this change.

Once you're done, someone will review your PR shortly (see the section "Who can review?" below to tag some potential reviewers). They may suggest changes to make the code even better. If no one reviewed your PR after a week has passed, don't hesitate to post a new comment @-mentioning the same persons---sometimes notifications get lost.
-->

<!-- Remove if not applicable -->

Fixes # (issue)


## Before submitting
- [ ] This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
- [ ] Did you read the [contributor guideline](https://github.com/huggingface/transformers/blob/master/CONTRIBUTING.md#start-contributing-pull-requests),
      Pull Request section?
- [ ] Was this discussed/approved via a Github issue or the [forum](https://discuss.huggingface.co/)? Please add a link
      to it if that's the case.
- [ ] Did you make sure to update the documentation with your changes? Here are the
      [documentation guidelines](https://github.com/huggingface/transformers/tree/master/docs), and
      [here are tips on formatting docstrings](https://github.com/huggingface/transformers/tree/master/docs#writing-source-documentation).
- [ ] Did you write any new necessary tests?


## Who can review?

Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.

<!-- Your PR 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.

Models:

- albert, bert, xlm: @LysandreJik
- blenderbot, bart, marian, pegasus, encoderdecoder,  t5: @patrickvonplaten, @patil-suraj
- longformer, reformer, transfoxl, xlnet: @patrickvonplaten
- fsmt: @stas00
- funnel: @sgugger
- gpt2: @patrickvonplaten, @LysandreJik
- rag: @patrickvonplaten, @lhoestq
- tensorflow: @LysandreJik

Library:

- benchmarks: @patrickvonplaten
- deepspeed: @stas00
- ray/raytune: @richardliaw, @amogkam
- text generation: @patrickvonplaten
- tokenizers: @n1t0, @LysandreJik
- trainer: @sgugger
- pipelines: @LysandreJik

Documentation: @sgugger

HF projects:

- datasets: [different repo](https://github.com/huggingface/datasets)
- rust tokenizers: [different repo](https://github.com/huggingface/tokenizers)

Examples:

- maintained examples (not research project or legacy): @sgugger, @patil-suraj
- research_projects/bert-loses-patience: @JetRunner
- research_projects/distillation: @VictorSanh

 -->

Comments:
Bad result in fine-tuning XLNet for SQuAD
Author: Timothy023
Pull request: no

Hello,

I'am fine-tuning XLNet for SQuAD V1.1 task, but I get the bad result. I got checkpoint of XLNet in [model hub](https://huggingface.co/xlnet-base-cased).

GPU: single GeForce RTX 3090 24G

running scripy:
`CUDA_VISIBLE_DEVICES=4 python ./examples/pytorch/question-answering/run_qa.py   --model_name_or_path ../pretrained_model/xlnet_base   --dataset_name squad   --do_train   --do_eval   --per_device_train_batch_size 12   --learning_rate 3e-5   --num_train_epochs 2   --max_seq_length 384   --doc_stride 128   --overwrite_output_dir   --output_dir ../squad/xlnet_base`

result:
`{
    "epoch": 2.0,
    "eval_samples": 10848,
    "exact_match": 12.639545884578997,
    "f1": 14.638577161480404,
    "train_runtime": 7179.3726,
    "train_samples": 88835,
    "train_samples_per_second": 2.062
}`


Comments:
Hi @Timothy023 

Please use the [forum](https://discuss.huggingface.co/) to post such questions. Thanks!

This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.

Please note that issues that do not follow the [contributing guidelines](https://github.com/huggingface/transformers/blob/master/CONTRIBUTING.md) are likely to be ignored.
How to train TFBertForTokenClassification without padding mechanism 
Author: brennenhuang
Pull request: no

I have a situation that input are variable-length, and I want to train sentence one by one. I do not want to use padding and train on batch.
In my study, Keras support fit-generator, but this mechanism deprecated on TF2
Is there any suggestion, I have no idea and need help

Comments:
Hello, thanks for opening an issue! We try to keep the github issues for bugs/feature requests.
Could you ask your question on the [forum](https://discusss.huggingface.co) instead?

Thanks!

This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.

Please note that issues that do not follow the [contributing guidelines](https://github.com/huggingface/transformers/blob/master/CONTRIBUTING.md) are likely to be ignored.
How to change training epochs when using run_summarization.py
Author: xuyeliu
Pull request: no

### 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.!-->

Models:

- bart, t5: @patrickvonplaten, @patil-suraj


## Information

I am using t5-large and t5-base to train my customer model with my customer csv dataset through running run_summarization.py. But I found that t5-small's performance is better than t5-base and t5-large. I think that is because we only train 3 epochs in run_summarization.py. Can you guys tell me how to change the training epochs? 

I'm not sure whether my thinking is correct. Feel free to provide more suggestion. After all, it is strange that the performance of t5-small is better than t5-large and t5-base. 

Thank you very much!!!


Comments:
Hi there,

`run_summarization.py` uses `Trainer`,  you can pass the `--num_train_epochs` to control the number of epochs. Please find the docs [here](https://huggingface.co/transformers/main_classes/trainer.html).

Also please use the [forum](https://discuss.huggingface.co/) to ask such questions, issues are for bugs and feature requests. Thanks!

This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.

Please note that issues that do not follow the [contributing guidelines](https://github.com/huggingface/transformers/blob/master/CONTRIBUTING.md) are likely to be ignored.