noamaanMulla-03/transformers-issues huggingface dataset:
Fix axial positional encoding calculations for  reformer.mdx
Author: ijindal
Pull request: yes

Fix axial positional encoding calculations

# What does this PR do?
This PR corrects the calculations for Axial Positional Encoding in Reformer model documentation. 

- Since d = d_1 + d_2
- if d = 2^10 = 1024
- then 
- d_1 and d_2 both should not be equal to 2^5. As 2^5 + 2^5 = 32+32 = 64 not equal to 1024. 
- d_1 and d_2 should sum to 2^10. Therefore I fixed the d_1 and d_2 dimensions to be equal to 2^9. 
- that is 2^9 + 2^9 = 1024.

and fixed the subsequent calculations. 


## Before submitting
- [x] 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/main/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/main/docs), and
      [here are tips on formatting docstrings](https://github.com/huggingface/transformers/tree/main/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:

- text models: @ArthurZucker and @younesbelkada
- vision models: @amyeroberts
- speech models: @sanchit-gandhi
- graph models: @clefourrier

Library:

- flax: @sanchit-gandhi
- generate: @gante
- pipelines: @Narsil
- tensorflow: @gante and @Rocketknight1
- tokenizers: @ArthurZucker
- trainer: @sgugger

Integrations:

- deepspeed: HF Trainer: @stas00, Accelerate: @pacman100
- ray/raytune: @richardliaw, @amogkam

Documentation: @sgugger, @stevhliu and @MKhalusova

HF projects:

- accelerate: [different repo](https://github.com/huggingface/accelerate)
- datasets: [different repo](https://github.com/huggingface/datasets)
- diffusers: [different repo](https://github.com/huggingface/diffusers)
- rust tokenizers: [different repo](https://github.com/huggingface/tokenizers)

Maintained examples (not research project or legacy):

- Flax: @sanchit-gandhi
- PyTorch: @sgugger
- TensorFlow: @Rocketknight1

 -->


Comments:
cc @ArthurZucker 

_The documentation is not available anymore as the PR was closed or merged._
remove position ids and token type ids from forward args in docstring
Author: ArthurZucker
Pull request: yes

# What does this PR do?
Fixes #21567 which indicated that the docstring for the GPTNeoX model dose not match with the forwards' arguments. 
Removed `position_ids` and `token_type_ids`

Comments:
_The documentation is not available anymore as the PR was closed or merged._

Applies to all the heads, that's why I removed it from the `GPT_NEOX_INPUTS_DOCSTRING` ! Or do you mean other models?
Add EfficientNet
Author: alaradirik
Pull request: yes

# What does this PR do?
Adds EfficientNet to transformers, see [original paper](https://arxiv.org/abs/1905.11946) and [repo](https://github.com/keras-team/keras/blob/v2.11.0/keras/applications/efficientnet.py). EfficientNet will be used as the vision encoder of the upcoming ALIGN PR.

- [x] Upload converted checkpoints for image classification
- [x] Create model cards
- [x] Update integration tests

Note: Failing tests are unrelated to this PR, will rebase to the main branch after the failing tests are fixed.

## 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/main/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/main/docs), and
      [here are tips on formatting docstrings](https://github.com/huggingface/transformers/tree/main/docs#writing-source-documentation).
- [ X] Did you write any new necessary tests?


Comments:
_The documentation is not available anymore as the PR was closed or merged._

Hmmm related to #17387, where the mode used is actually EfficientNet.... So it is multimodal, but the processing is on the audio part. Should probably have better synched on this one! 

@ArthurZucker aha, I wasn't aware of Trillson indeed, the final phase of the blocks and the top are different but we could have saved some of the work
Fix typo in `PROCESSOR_MAPPING_NAMES` and add tests
Author: ydshieh
Pull request: yes

# What does this PR do?

Fix typo in `PROCESSOR_MAPPING_NAMES` and add a new repo check: we check all names in auto (name) mapping are defined in the library.

The effect of this PR: (if `GITProcessor` is not fixed)

```bash
Checking all names in auto name mappings are defined.
Traceback (most recent call last):
  File "C:\Users\33611\Desktop\Project\transformers-hf-gcp\utils\check_repo.py", line 922, in <module>
    check_repo_quality()
  File "C:\Users\33611\Desktop\Project\transformers-hf-gcp\utils\check_repo.py", line 918, in check_repo_quality
    check_all_auto_object_names_being_defined()
  File "C:\Users\33611\Desktop\Project\transformers-hf-gcp\utils\check_repo.py", line 640, in check_all_auto_object_names_being_defined
    raise Exception(f"There were {len(failures)} failures:\n" + "\n".join(failures))
Exception: There were 1 failures:
`GITProcessor` appears in the mapping `PROCESSOR_MAPPING_NAMES` but it is not defined in the library.
```

Comments:
_The documentation is not available anymore as the PR was closed or merged._

Failing test is irrelevant
Fix `get_class_in_module`
Author: ydshieh
Pull request: yes

# What does this PR do?

The PR #21646 added a line `subprocess.run(["python", "-c", cmd])`. But in our daily CI (docker env.), `python` binary doesn't exist, only `python3` binary exists, and this causes `FileNotFoundError: [Errno 2] No such file or directory: 'python'`.

This PRs adds `try ... except...` to avoid this failure, but it's really ugly. See my comment in this PR changes.

Comments:
_The documentation is not available anymore as the PR was closed or merged._
[Model] M2M-100 Multilingual machine translation
Author: flozi00
Pull request: no
Labels: name: New model

# 🌟 New model addition

## Model description
Facebook AI is introducing, 
M2M-100
 the first multilingual machine translation (MMT) model that translates between any pair of 100 languages without relying on English data.
<!-- Important information -->

## Open source status

* [x] the model implementation is available: (give details)  https://github.com/pytorch/fairseq/tree/master/examples/m2m_100?fbclid=IwAR2Oqew-PAwZpTmHMrq_yiXN2dwdzzbTMZ-4HfbNKfdoZ_M5TpQiPY3dYFo
* [x] the model weights are available: (give details) https://dl.fbaipublicfiles.com/m2m_100/12b_last_checkpoint.pt
* [ ] who are the authors: (mention them, if possible by @gh-username)


Comments:
This model is very big. Is there a good way to prune it?

Moving to #8054 which is a duplicate (that I created)!

> This model is very big. Is there a good way to prune it?

@Bachstelze Did you find any ways to distill or prune such a large model?

@robotsp 
There is a smaller version: https://huggingface.co/alirezamsh/small100
[SMaLL-100: Introducing Shallow Multilingual Machine Translation Model for Low-Resource Languages](https://aclanthology.org/2022.emnlp-main.571.pdf)
ConvNeXT V2
Author: IMvision12
Pull request: no
Labels: name: New model

### Model description

Short Description
Just released - ConvNeXt with a new internal layer.

In this paper, Authors propose a fully convolutional masked autoencoder framework and a new Global Response Normalization (GRN) layer that can be added to the ConvNeXt architecture to enhance inter-channel feature competition.

# Contribution 

## I would like to work on this!

### Open source status

- [X] The model implementation is available
- [X] The model weights are available

### Provide useful links for the implementation

Papers
https://arxiv.org/abs/2301.00808

Official Implementations
https://github.com/facebookresearch/ConvNeXt-V2

@NielsRogge @alaradirik

Comments:
Hi @IMvision12! Thanks for taking this on, I think ConvNeXT V2 would be a great addition to transformers.

If you have any questions about the internal logic of the library or run into issues, you can ping me or @NielsRogge anytime. We can also create a Slack channel and continue the collaboration on the PR over there if you'd like. 

@IMvision12 I sent the invite, looking forward to adding ConvNeXT V2 to transformers!

Hello, I'd like to work on this issue. How do I get started?

Hi @asrimanth, I took over the PR and I'm almost done with it. Feel free to look at other open issues though!
Time series transformer: input projection and Std scaler
Author: kashif
Pull request: yes

# What does this PR do?

Add initial input projection layer and `d_model` hyperparam
Added a StdScaler for time series transformer as well as corresponding features.

## 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/main/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/main/docs), and
      [here are tips on formatting docstrings](https://github.com/huggingface/transformers/tree/main/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:

- text models: @ArthurZucker and @younesbelkada
- vision models: @amyeroberts and @NielsRogge
- speech models: @sanchit-gandhi

Library:

- flax: @sanchit-gandhi
- generate: @gante
- pipelines: @Narsil
- tensorflow: @gante and @Rocketknight1
- tokenizers: @ArthurZucker
- trainer: @sgugger

Integrations:

- deepspeed: @stas00
- ray/raytune: @richardliaw, @amogkam

Documentation: @sgugger, @stevhliu and @MKhalusova

HF projects:

- accelerate: [different repo](https://github.com/huggingface/accelerate)
- datasets: [different repo](https://github.com/huggingface/datasets)
- diffusers: [different repo](https://github.com/huggingface/diffusers)
- rust tokenizers: [different repo](https://github.com/huggingface/tokenizers)

Maintained examples (not research project or legacy):

- Flax: @sanchit-gandhi
- PyTorch: @sgugger
- TensorFlow: @Rocketknight1

 -->


Comments:
_The documentation is not available anymore as the PR was closed or merged._

@NielsRogge I have one more fix here... I can make `static_real_features` be optional

@NielsRogge i believe this can be merged so i can then start to add these changes to the informer model... what do you think?
Enable flake8-comprehension ruff checks
Author: Skylion007
Pull request: no

### Feature request

* Ruff was recently added as a linter to huggingface transformers. It provides support out of the box for flake8-comprehension checks which improve list/set/dict comprehensions in Python and make them more readable and faster. Additionally, ruff has autofixits for all these rules so applying them automatically to the codebase is really straightforward and should improve the style of the codebase and make it more readable.

### Motivation

Better Faster / Improved Code

### Your contribution

Applying flake8-comprehension linter to library and enabling it.

Comments:
Error with shape-assertion regarding head_masks in mbart_modeling file
Author: josh-oo
Pull request: no

### System Info

file: https://github.com/huggingface/transformers/blob/v4.26.1/src/transformers/models/mbart/modeling_mbart.py
commit-hash: fd5cdaeea6eafac32e9d967327bfa3dc0e0d962d

### Who can help?

@ArthurZucker @younesbelkada

### Information

- [ ] The official example scripts
- [X] My own modified scripts

### Tasks

- [ ] An officially supported task in the `examples` folder (such as GLUE/SQuAD, ...)
- [ ] My own task or dataset (give details below)

### Reproduction

Call the forward method of MBartModel with:
- head_mask=None,
- decoder_head_mask=None,
 and 
- cross_attn_mask=torch.ones(mismatching_layer_size, number_of_heads)

### Expected behavior

**Expected Output:** The cross_attn_head_mask should be specified for X layers, but it is for Y.
**Actual Output:** 'NoneType' object has no attribute 'size'

**Potential fix:** The head_mask from line 1058 should probably reference the attn_mask from line 1053.


Comments:
Great catch! The PR https://github.com/huggingface/transformers/pull/21730 should add the fix you proposed
[`MBart`] Fix cross attention mask check
Author: younesbelkada
Pull request: yes

# What does this PR do?

Fixes https://github.com/huggingface/transformers/issues/21728

The current `MBart` code leads to an error that is hard to interpret for users due to a possible typo as pointed out in https://github.com/huggingface/transformers/issues/21728 
To reproduce: 
```python
import torch
from transformers import MBartModel

input_ids = torch.LongTensor([[0, 1, 1, 0]])
model = MBartModel.from_pretrained("facebook/mbart-large-cc25")

head_mask = None

cross_attn_head_mask = torch.ones(1000, 1, 1, 1)
model(input_ids, head_mask=head_mask, cross_attn_head_mask=cross_attn_head_mask)
```

This PR fixes this

cc @sgugger 

Comments:
_The documentation is not available anymore as the PR was closed or merged._
Change doc example for `BigBirdForQuestionAnswering`
Author: ydshieh
Pull request: yes

# What does this PR do?

Checkpoint `"abhinavkulkarni/bigbird-roberta-base-finetuned-squad"` is no longer public or is removed by the user. Use base model `google/bigbird-roberta-base` and not to test against expected outputs.

Comments:
_The documentation is not available anymore as the PR was closed or merged._
Fix `ErnieMEmbeddings` device issue
Author: ydshieh
Pull request: yes

# What does this PR do?

Fix `ErnieMEmbeddings` CI failure for 
```bash
tests/models/ernie_m/test_modeling_ernie_m.py::ErnieMModelTest::test_multi_gpu_data_parallel_forward
```

See comments in the changes.

Comments:
_The documentation is not available anymore as the PR was closed or merged._
Fix `GPTSanJapaneseModel`
Author: ydshieh
Pull request: yes

# What does this PR do?

```
return_dict = return_dict if return_dict is not None else self.config.return_dict
```
should be
```
return_dict = return_dict if return_dict is not None else self.config.use_return_dict
```
as in many other places.

Otherwise torchscript tests will fail.

Comments:
_The documentation is not available anymore as the PR was closed or merged._
Fix to KerasMetricCallback when the model returns unstructured output
Author: Rocketknight1
Pull request: yes

The `KerasMetricCallback` was only tested on `transformers` models, which usually return dict-like `ModelOutput`. As a result, I missed a bug when the model is a more classical Keras model that just returns a naked array. Thanks to @leadbetterben for pointing out the issue.

Fixes #21674 .

Comments:
_The documentation is not available anymore as the PR was closed or merged._

I don't even know if we're testing this callback at all, because it's not really a core piece of `transformers`. I'll merge this for now and then think about where we could add some tests in a future PR!
[Time series] Temporal Fusion Transformer model
Author: kashif
Pull request: yes

# What does this PR do?

Adding Temporal Fusion Transformer time series model https://arxiv.org/pdf/1912.09363.pdf

Comments:
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/main/CONTRIBUTING.md) are likely to be ignored.
fix convert longformer to onnx bug
Author: SysuCharon
Pull request: yes

class `LongformerOnnxConfig`
property `inputs`
miss one input `"token_type_ids"`


```shell
# before fix : onnx input node
name: "token_type_ids"
type {
  tensor_type {
    elem_type: 7
    shape {
      dim {
        dim_value: 2
      }
      dim {
        dim_value: 8
      }
    }
  }
}

# after fix : onnx input node
name: "token_type_ids"
type {
  tensor_type {
    elem_type: 7
    shape {
      dim {
        dim_param: "batch"
      }
      dim {
        dim_param: "sequence"
      }
    }
  }
}
```

Comments:
@deutschmn 

_The documentation is not available anymore as the PR was closed or merged._

cc @lewtun 

As far as I know, Longformer, like RoBERTa, doesn't use token_type_ids see #9111 and https://huggingface.co/docs/transformers/model_doc/longformer

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/main/CONTRIBUTING.md) are likely to be ignored.

Gently pinging @fxmarty in case he has bandwidth to take a look

The docs for this PR live [here](https://moon-ci-docs.huggingface.co/docs/transformers/pr_20191). All of your documentation changes will be reflected on that endpoint.

I think

> As far as I know, Longformer, like RoBERTa, doesn't use token_type_ids see https://github.com/huggingface/transformers/issues/9111 and https://huggingface.co/docs/transformers/model_doc/longformer

is a good answer!

@SysuCharon could you provide a code that you are expecting to see working but which does not?

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/main/CONTRIBUTING.md) are likely to be ignored.

not stale

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/main/CONTRIBUTING.md) are likely to be ignored.
TokenGT for graph classification
Author: clefourrier
Pull request: yes

# What does this PR do?

Adds the TokenGT model for graph classification in Transformers.

Done:
- [x] Architecture ported
- [x]  Collator (the model has no tokenizer) and preprocessing

Todo:
- [ ] Test results against original implementation, to make sure they are within precision range. Edit: exactly same results :fire: 
- [ ] Add checkpoints and make sure they load properly
- [ ] Update doc
- [ ] Update test suite
- [ ] Add model card for the checkpoints once added

## Dependencies
Cython - this could be ported to Python, but preprocessing will be considerably slower, as well as collation if preprocessing is done on the fly. 

Linked to #21079

## Before submitting
- [x] Did you read the [contributor guideline](https://github.com/huggingface/transformers/blob/main/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. (Discussed on Slack)
- [ ] Did you make sure to update the documentation with your changes? Here are the
      [documentation guidelines](https://github.com/huggingface/transformers/tree/main/docs), and
      [here are tips on formatting docstrings](https://github.com/huggingface/transformers/tree/main/docs#writing-source-documentation).
- [ ] Did you write any new necessary tests?


## Who can review?

Not tagging anyone for now as this is a draft.

Comments:
@Raman-Kumar Here is a first draft to get you started!

I suggest you start by finding a checkpoint, then try to compare the execution step by step with the original model to make sure results are the same (I can provide you with the script I used for Graphormer if you need). I also added some todos in the code, which can help you get started too! Feel free to compare everything with the Graphormer PR to get an idea of the process and things to do!

_The documentation is not available anymore as the PR was closed or merged._

👏 Okay doing that ...
@clefourrier may need a little relaxed timeline, studying a few more things

@Raman-Kumar Take the time you need, there is no urgency on my side; feel free to ping me if you need help later on!

Sorry for accidentally closing it

Closing and replacing with #21745 21745