noamaanMulla-03/transformers-issues huggingface dataset:
An unexpected argument in the ResNet Flax implementation
Author: pingzhili
Pull request: no

### System Info

The class `FlaxResNetBasicLayerCollection` does not expect the argument `activation`, but here passes it and would raise error:
https://github.com/huggingface/transformers/blob/8a312956fd49efd69adb98c40996719d4c276a01/src/transformers/models/resnet/modeling_flax_resnet.py#L215-L220

The definition of `FlaxResNetBasicLayerCollection` is:
https://github.com/huggingface/transformers/blob/8a312956fd49efd69adb98c40996719d4c276a01/src/transformers/models/resnet/modeling_flax_resnet.py#L180-L194

### Who can help?

@amyeroberts

### Information

- [ ] The official example scripts
- [ ] 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

A minimal reproducible example:
```
from transformers import FlaxResNetForImageClassification, ResNetConfig

model = FlaxResNetForImageClassification(config=ResNetConfig(layer_type="basic"))
```

### Expected behavior

Raise `TypeError: FlaxResNetBasicLayerCollection.__init__() got an unexpected keyword argument 'activation'`

Comments:
Hi @pingzhili, thanks for raising this issue! 

Indeed, it seems that `activation` shouldn't be passed to FlaxResNetBasicLayerCollection [here](https://github.com/huggingface/transformers/blob/5964f820db1568d26298b37dea9db328185c7f7c/src/transformers/models/resnet/modeling_flax_resnet.py#L218C3-L218C3). Would you like to open a PR to fix this? This way you get the github contribution for spotting the issue and resolving it.  

Thanks, I will open a PR for this later.
Unable to uninstall transformers package 
Author: Ahmed-Roushdy
Pull request: no

### System Info

Copy-and-paste the text below in your GitHub issue and FILL OUT the two last points.

- `adapter-transformers` version: 3.2.1
- Platform: Linux-5.8.0-59-generic-x86_64-with-glibc2.17
- Python version: 3.8.16
- Huggingface_hub version: 0.12.1
- PyTorch version (GPU?): 1.11.0+cu113 (True)
- Tensorflow version (GPU?): not installed (NA)
- Flax version (CPU?/GPU?/TPU?): not installed (NA)
- Jax version: not installed
- JaxLib version: not installed
- Using GPU in script?: <fill in>
- Using distributed or parallel set-up in script?: <fill in>

### Who can help?

 @ArthurZucke

### Information

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

### Tasks

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

### Reproduction

```
 pip uninstall transformers
Uninstalling transformers-4.26.1:
  Would remove:
    /opt/miniconda3/bin/transformers-cli
    /opt/miniconda3/lib/python3.8/site-packages/transformers-4.26.1.dist-info/*
    /opt/miniconda3/lib/python3.8/site-packages/transformers/*
Proceed (Y/n)? Y
ERROR: Exception:
Traceback (most recent call last):
  File "/opt/miniconda3/lib/python3.8/shutil.py", line 791, in move
    os.rename(src, real_dst)
PermissionError: [Errno 1] Operation not permitted: '/opt/miniconda3/bin/transformers-cli' -> '/tmp/pip-uninstall-hvzzdqd1/transformers-cli'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/miniconda3/lib/python3.8/site-packages/pip/_internal/cli/base_command.py", line 169, in exc_logging_wrapper
    status = run_func(*args)
  File "/opt/miniconda3/lib/python3.8/site-packages/pip/_internal/commands/uninstall.py", line 105, in run
    uninstall_pathset = req.uninstall(
  File "/opt/miniconda3/lib/python3.8/site-packages/pip/_internal/req/req_install.py", line 680, in uninstall
    uninstalled_pathset.remove(auto_confirm, verbose)
  File "/opt/miniconda3/lib/python3.8/site-packages/pip/_internal/req/req_uninstall.py", line 381, in remove
    moved.stash(path)
  File "/opt/miniconda3/lib/python3.8/site-packages/pip/_internal/req/req_uninstall.py", line 272, in stash
    renames(path, new_path)
  File "/opt/miniconda3/lib/python3.8/site-packages/pip/_internal/utils/misc.py", line 313, in renames
    shutil.move(old, new)
  File "/opt/miniconda3/lib/python3.8/shutil.py", line 812, in move
    os.unlink(src)
PermissionError: [Errno 1] Operation not permitted: '/opt/miniconda3/bin/transformers-cli' 
```

### Expected behavior

to successfully uninstall the package 

Comments:
Hi @Ahmed-Roushdy, thanks for opening an issue. 

From the error, it looks like this isn't a transformers library but due to not having write access for running pip in the environment. As such, this isn't something we're able to help with. If you installed `transformers` using `sudo`, you should try uninstalling with `sudo` too.
Update sequence_classification.md
Author: akshayvkt
Pull request: yes

# What does this PR do?

Resolve the ImportError raised when running the [Text classification](https://huggingface.co/docs/transformers/tasks/sequence_classification) notebook.

I'm adding accelerate as one of the libraries to instal, as the model would otherwise error out with the below error when we attempt to run the Trainer.

`ImportError: Using the `Trainer` with `PyTorch` requires `accelerate>=0.20.1`: Please run `pip install transformers[torch]` or `pip install accelerate -U`
`

![image](https://github.com/huggingface/transformers/assets/64036106/e2c4a27b-73a4-41df-a8a0-8b3d1eafe9a5)
 
Further context: 
1. I've tried this across different environments so I believe that the environment is not the issue. 
2. I had the latest transformers library version running. 
3. Typically even after install accelerate and import it, it wouldn't resolve the issue until I restart the notebook and try again.


## 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.
- [ ] 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? @ArthurZucker and @younesbelkada

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.



Comments:
The docs for this PR live [here](https://moon-ci-docs.huggingface.co/docs/transformers/pr_27281). All of your documentation changes will be reflected on that endpoint.
Fast T5 tokenization fails for models with additional special tokens not prefixed by extra_id_
Author: LoicDagnas
Pull request: no

### System Info

- `transformers` version: 4.34.1
- Platform: Windows-10-10.0.22621-SP0
- Python version: 3.9.12
- Huggingface_hub version: 0.16.4
- Safetensors version: 0.3.2
- Accelerate version: not installed
- Accelerate config: not found
- PyTorch version (GPU?): 1.13.1+cpu (False)
- Tensorflow version (GPU?): 2.13.0 (False)
- Flax version (CPU?/GPU?/TPU?): not installed (NA)
- Jax version: not installed
- JaxLib version: not installed
- Using GPU in script?: no
- Using distributed or parallel set-up in script?: no


### Who can help?

@ArthurZucker @amyeroberts 

### Information

- [ ] The official example scripts
- [ ] 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

As described [here](https://github.com/huggingface/transformers/pull/23909#issuecomment-1785240174), when I try to load this tokenizer

```python
from transformers import AutoTokenizer

AutoTokenizer.from_pretrained("iarfmoose/t5-base-question-generator")
```

[This exception](https://github.com/huggingface/transformers/blob/e4dad4fe32525c26eccb5790c258aa271476ac33/src/transformers/models/t5/tokenization_t5_fast.py#L127) is raised.


### Expected behavior

The tokenizer should be loaded without error as it was for version < 4.34

Comments:
Hey, the PR was merged and should have been part of the latest release. I no longer have this issue on main, nor on `transformers == 4.35.0`. It was not included in the patch as it was reported after 😉 

It works with the latest release, thank you
Added FlashAttention Support  for GPT2
Author: canberk17
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.
-->

Adds flash attention support for GPT2



Contribution to #26350 

@younesbelkada 




Comments:
Hi @younesbelkada , I am trying to add FlashAttention support for GPT2 but some of my checks are failing : test_flax, test_tf etc. and they are pointing at Falcon Override Test Failures.


I referenced edit made [here](https://github.com/huggingface/transformers/pull/26463/files), while making   my changes. Why could this be happening, as these errors are not pointing at the files I changed?





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.
i am facing with issues to convert llama-2-13b into vicuna i got all the time the following  #21366 )  "Fetching all parameters from the checkpoint at /content/drive/MyDrive/anomalyGPT/llama/llama-2-13b/13B".a
Author: eichi7
Pull request: no


<img width="289" alt="Screenshot 2023-09-28 at 15 05 05" src="https://user-images.githubusercontent.com/110445849/271219265-cb005255-3218-4727-996e-a480853f7357.png">
              i am facing with issues to convert llama-2-13b into vicuna i got all the time the following  #21366 )  "Fetching all parameters from the checkpoint at /content/drive/MyDrive/anomalyGPT/llama/llama-2-13b/13B".a
^C
fter executing that command !python -m transformers.models.llama.convert_llama_weights_to_hf --input_dir /content/drive/MyDrive/anomalyGPT/llama/llama-2-13b  --model_size 13B --output_dir /content/drive/MyDrive/anomalyGPT/llama/huggingface_llama_13B

_Originally posted by @eichi7 in https://github.com/huggingface/transformers/issues/25818#issuecomment-1738655450_
            

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.
support for MistralForCausalLM
Author: NarenZen
Pull request: no

### Feature request

Mistral AI claims its supports VLLM. 
`python -u -m vllm.entrypoints.openai.api_server --host 0.0.0.0 --model mistralai/Mistral-7B-v0.1`

But getting error:
`ValueError: Model architectures ['MistralForCausalLM'] are not supported for now. Supported architectures: ['AquilaModel', 'BaiChuanForCausalLM', 'BaichuanForCausalLM', 'BloomForCausalLM', 'FalconForCausalLM', 'GPT2LMHeadModel', 'GPTBigCodeForCausalLM', 'GPTJForCausalLM', 'GPTNeoXForCausalLM', 'InternLMForCausalLM', 'LlamaForCausalLM', 'LLaMAForCausalLM', 'MPTForCausalLM', 'OPTForCausalLM', 'QWenLMHeadModel', 'RWForCausalLM']`

Comments:
Hey @NarenZen, `Mistral` is on the `main` branch and not in a stable release until early next week.

Would you mind installing `transformers` from source until then? You can do so with:
```
pip install git+https://github.com/huggingface/transformers
```

Please let me know if you run into any issues!

Hey,

By installing `transformers` using the [commit](https://github.com/huggingface/transformers/commit/72958fcd3c98a7afdc61f953aa58c544ebda2f79) for the Mistral support you can get the model work:

`pip install git+https://github.com/huggingface/transformers@72958fc`

If you install from `main` you might encounter unrelated issues due to continuous developments on that branch.

The `main` branch should be quite stable though :)

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.
[Whisper] Block language/task args for English-only
Author: sanchit-gandhi
Pull request: yes

# What does this PR do?

The `language`/`task` args should only be forwarded to the multilingual Whisper models. Passing these args to the English-only models gives the wrong error message currently:
```
ValueError: The generation config is outdated and is thus not compatible with the `language` argument 
to `generate`. Either set the language using the `forced_decoder_ids` in the model config, or update 
the generation config as per the instructions https://github.com/huggingface/transformers/issues/25084#issuecomment-1664398224
```
This PR blocks these args for the English-only models with an appropriate error message.

cc @Vaibhavs10 


Comments:
Thanks for taking care of this so swiftly! 🤗 

_The documentation is not available anymore as the PR was closed or merged._
Fix autoawq docker image
Author: younesbelkada
Pull request: yes

# What does this PR do?

Fixes AWQ-related failing tests in: https://github.com/huggingface/transformers/actions/runs/6779219624/job/18426184991
Autoawq recently made a release that distributed pre-compiled kernels on CUDA 12.2. Our VM support CUDA 11.8
As we were testing everything before that release, we need to correctly install the package to retrieve the kernels compiled with cuda 11.8, as per the installation guidelines in autoawq: https://github.com/casper-hansen/AutoAWQ#install

cc @ydshieh @amyeroberts 


Comments:
The docs for this PR live [here](https://moon-ci-docs.huggingface.co/docs/transformers/pr_27339). All of your documentation changes will be reflected on that endpoint.
[`Whisper`]  Add conversion script for the tokenizer 
Author: ArthurZucker
Pull request: yes

# What does this PR do?
Aligned with #27336  this PR adds the conversion of the tokenizer form `tiktoken` to `transformers`

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

The docs for this PR live [here](https://moon-ci-docs.huggingface.co/docs/transformers/pr_27338). All of your documentation changes will be reflected on that endpoint.
Resolve AttributeError by utilizing device calculation at the start of the forward function
Author: folbaeni
Pull request: yes

# What does this PR do?

This commit addresses the 'NoneType' object AttributeError within the IdeficsModel forward function. Previously, the 'device' attribute was accessed directly from input_ids, resulting in a potential 'NoneType' error. Now, the device is taken by the one properly calculated at the beginning of the forward function and utilized consistently throughout, ensuring the 'image_hidden_states' are derived from the correct device. This modification enables smoother processing and compatibility, ensuring the correct device attribution for 'image_encoder_embeddings' in the IdeficsModel forward pass.

Fixes #27343 


## 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?
- [ 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/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?
@ArthurZucker @younesbelkada @amyeroberts


Comments:
The docs for this PR live [here](https://moon-ci-docs.huggingface.co/docs/transformers/pr_27347). All of your documentation changes will be reflected on that endpoint.
IDEFICS AttributeError: 'NoneType' object has no attribute 'device' when calling forward with inputs_embeds and image_encoder_embeddings
Author: folbaeni
Pull request: no

### System Info

- `transformers` version: 4.35.0.dev0
- Platform: Linux-6.1.0-10-amd64-x86_64-with-glibc2.36
- Python version: 3.10.8
- Huggingface_hub version: 0.17.3
- Safetensors version: 0.4.0
- Accelerate version: 0.24.0
- Accelerate config:    not found
- PyTorch version (GPU?): 2.0.1+cu117 (True)
- Tensorflow version (GPU?): not installed (NA)
- Flax version (CPU?/GPU?/TPU?): not installed (NA)
- Jax version: not installed
- JaxLib version: not installed
- Using GPU in script?: <fill in>
- Using distributed or parallel set-up in script?: <fill in>

### Who can help?

@ArthurZucker  @younesbelkada @amyeroberts

### Information

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

### Tasks

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

### Reproduction

Steps to reproduce the behavior:

1.  Utilize the forward function with inputs_embeds and image_encoder_embeddings.
2.   Execute the code, which leads to the line causing the AttributeError as described above.

### Expected behavior

The code should execute without encountering the 'NoneType' object AttributeError and should properly assign the 'image_hidden_states' based on the 'image_encoder_embeddings' and input devices.

Comments:
Hey! Could you share the full reproducer please? 🤗
Bark TTS - batch inference silence/noise
Author: pawlowskipawel
Pull request: no

Hi, 
when I perform batch inference with Bark model, all the output `.wav` files have the same duration, even though some transcriptions are much shorter than others, and the difference is filled with silence/noise. Is there a way to get information about when the model stops synthesizing the transcription, so that I can trim that silence after the generation process?

Comments:
@pawlowskipawel Please provide a concise code snippet together your system env. information when opening an issue. Thank you!

Related to #26673 !
Allow scheduler parameters
Author: Plemeur
Pull request: yes

# What does this PR do?
Allow passing keywords argument for the Learning rate scheduler, can be useful for Cosine with Restart and Polynomial LR scheduler (and for potential future lr schedulers) 

If necessary I can add some check for the parameters to make sure that the user gets a more sensible error message when passing mismatched arguments, right now it assumes the user knows what they are doing 


- trainer: @muellerzr and @pacman100



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

Gentle ping @muellerzr @pacman100
Remove a redundant variable.
Author: hisushanta
Pull request: yes

Remove the redundant variable from the feature_extraction.py file.

Here's what it looks like now!:
![Screenshot (12)](https://github.com/huggingface/transformers/assets/93595990/931e2f09-08c7-413e-9204-3af856a3df22)

## Before submitting
- [x] 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?
- [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.
- [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).
- [ ] Did you write any new necessary tests?




Comments:
The docs for this PR live [here](https://moon-ci-docs.huggingface.co/docs/transformers/pr_27288). All of your documentation changes will be reflected on that endpoint.
[Flash Attention 2]: flash attention 2 support for BLOOM
Author: elaaaf
Pull request: no

part of [26350](https://github.com/huggingface/transformers/issues/26350)

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.