noamaanMulla-03/transformers-issues huggingface dataset:
ImportError: Using the `Trainer` with `PyTorch` requires `accelerate>=0.20.1`: Please run `pip install transformers[torch]` or `pip install accelerate -U`
Author: cssndrx
Pull request: no

### System Info

I'm running the example code from 
https://huggingface.co/docs/transformers/training

on a Colab

and it's failing with 
[/usr/local/lib/python3.10/dist-packages/transformers/training_args.py](https://localhost:8080/#) in _setup_devices(self)
   1670         if not is_sagemaker_mp_enabled():
   1671             if not is_accelerate_available(min_version="0.20.1"):
-> 1672                 raise ImportError(
   1673                     "Using the `Trainer` with `PyTorch` requires `accelerate>=0.20.1`: Please run `pip install transformers[torch]` or `pip install accelerate -U`"
   1674                 )

ImportError: Using the `Trainer` with `PyTorch` requires `accelerate>=0.20.1`: Please run `pip install transformers[torch]` or `pip install accelerate -U`


However, it still gives the error even after I pip install the recommended libraries.

Also, pip freeze shows that accelerate is accelerate==0.20.3 which should satisfy the requirement of `accelerate>=0.20.1` - so I'm not sure why the Trainer is throwing the error.

Thanks for taking a look @sgugger 

### Who can help?

@sgugger 

### Information

- [X] 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)

### Expected behavior

To run training

Comments:
You need to restart your colab environment after updating the library.

thanks @sgugger for the quick fix! I was having the same issue as mentioned by @cssndrx . 

Thank you @sgugger, that was the issue! 

Thanks, I was having the same issue!


restart virtalenv slove my same issue,thanks

wow! Thanks alot @sgugger

Restarting the notebook and the kernel resolve it also for me

> You need to restart your colab environment after updating the library.

Thank you.

Getting this error just by running the cells first time and restart also doesn't work

Restart even doesn't work me either

I was having the same issue, restarting also worked for me!

I am having this issue in my local machine. How to resolve it there?

@NavneetSajwan  try to restart the notebook.

I am having the same issue in my colab environment, after updating the notebook worked for me!

Thank you!@sgugger. Same problem solved.

wow great restart also worked for me.. mannnnyyy thanks


"Is there an alternative method? Restarting and rerunning all the cells consumes a significant amount of time.

> Restart even doesn't work me either

Step1:
!pip install transformers[torch] --- run installation
Step2:
#!pip install transformers[torch] --- comment out the installaltion
Step3:
Restart Colab Session

I am running the jupyter notebook on my VScode, which is connected to a jupyter server. I need not restart the jupyter server itself. But just restart the notebook and it worked.

thanks @sgugger 
It works for me
Don't set `run_name` when none
Author: qgallouedec
Pull request: yes

# What does this PR do?

All the tracking library support `run_name=None`, and usually generate a name in this case, which can be quite practical.
Consequently, we don't need setting this value to `output_dir` when `None`


Comments:
The docs for this PR live [here](https://moon-ci-docs.huggingface.co/docs/transformers/pr_39695). All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.
Significant WER Increase with Whisper Chunking Compared to Long-Form Transcription
Author: Parvezkhan0
Pull request: no
Labels: name: bug

### System Info

I conducted several experiments using Whisper and Seamless M4Tv2 on the FLEURS dataset (with audio files concatenated into 5-minute samples). I utilized the batching feature by setting ` chunk_length_s` to 30 seconds. Surprisingly, this chunking approach led to a 20% higher Word Error Rate (WER) across all languages compared to long-form (sequential) transcription.

### Who can help?

_No response_

### 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

Use the default Whisper pipeline on audio files that are several minutes long. When chunk_length_s is enabled (e.g., set to 30 seconds), the transcription quality significantly degrades compared to processing the entire audio sequentially without chunking.










### Expected behavior

 A 20% increase seems excessively high to me. I'd expect chunking to cause only a slight drop in accuracy — perhaps a few percentage points at most — not this significant.



Comments:
I have experienced something that can help you @Parvezkhan0 , I found that different transformers version leads to different results sometimes, For short form (dataset evaluation for example) seems to be better on version 4.51.3 (i think after version 4.50.0) and timestamps long-form better on version 4.46.0 than on recent versions, i have no idea why , but i tested this on some audios.
here is a link for a discussion i just opened: [discussion](https://github.com/openai/whisper/discussions/2602)

@Parvezkhan0 not sure if this related, but seems a change introduced that caused issues in whisper, this issue is opened and pr is submitted [PR](https://github.com/huggingface/transformers/issues/38378)

Seeing this reported in a couple of places, cc @eustlb @vasqu

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.

IMO this is unrelated to https://github.com/huggingface/transformers/issues/38378. It does make sense that you get a higher WER when switching to chunked, since Whisper is not supposed to be used with chunking for long form but rather it's own sequential algortith (so set `chunk_length_s=0`). Nevertheless it's True that a +20% increase is a lot, and there are already known bugs in the pipeline (cf #36632, #35750)! So I'll be having a stab at this! 🤗

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.
How to streaming output audio of Qwen2.5-omni-7b
Author: qinxuye
Pull request: no

All the examples of qwen2.5-omni-7b did not show how to streaming output audio, with passing streamer, I am able to get streaming text, but how can I get the streaming audio output?

Comments:
@qinxuye hey! We dont' support streaming for audio generation in transformers. AFAIK there is no plan to support streaming, but might be wrong. cc @eustlb for audio models

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.

Hey there, sorry for the late answer. Actually, it's something we have on the roadmap, and you can custom build one, getting inspiration from what's been done in [this space](https://huggingface.co/spaces/sanchit-gandhi/parler-tts-streaming/blob/main/app.py). Hope this helps 🤗

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.
[ASR pipline] fix with datasets 4.0
Author: eustlb
Pull request: yes

# What does this PR do?

Cf code comments!

Comments:
The docs for this PR live [here](https://moon-ci-docs.huggingface.co/docs/transformers/pr_39504). All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

Just wondering if #39309 is still relevant after this PR ?
[Voxtral] Fix typo
Author: NielsRogge
Pull request: yes

# What does this PR do?

This PR fixes a small typo in a method name.

cc @eustlb 

Comments:
**[For maintainers]** Suggested jobs to run (before merge)

run-slow: voxtral

The docs for this PR live [here](https://moon-ci-docs.huggingface.co/docs/transformers/pr_39540). All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.
more info in `model_results.json`
Author: ydshieh
Pull request: yes

# What does this PR do?

Add `skipped` and `errors` counts

Comments:
The docs for this PR live [here](https://moon-ci-docs.huggingface.co/docs/transformers/pr_39783). All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.
mllama outputs refactor
Author: itazap
Pull request: yes

refactor using latest outputs merge 

Comments:
The docs for this PR live [here](https://moon-ci-docs.huggingface.co/docs/transformers/pr_39643). All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

**[For maintainers]** Suggested jobs to run (before merge)

run-slow: mllama
Super tiny update
Author: zucchini-nlp
Pull request: yes

# What does this PR do?

Calling the processor with video inputs raises warning `Unused kwargs "images"` because we are passing `images=None` to the video processor

Comments:
**[For maintainers]** Suggested jobs to run (before merge)

run-slow: qwen2_5_omni

The docs for this PR live [here](https://moon-ci-docs.huggingface.co/docs/transformers/pr_39727). All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.
Mllama new outputs - fixing integration tests 
Author: itazap
Pull request: yes

fixing integration tests!

Comments:
**[For maintainers]** Suggested jobs to run (before merge)

run-slow: mllama

The docs for this PR live [here](https://moon-ci-docs.huggingface.co/docs/transformers/pr_39784). All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.
autoawq has been deprecated. Is it possible to support the use of llm-compresser as an alternative to autoawq
Author: 0O0OwO0O0
Pull request: no

autoawq has been deprecated. Is it possible to support the use of llm-compresser as an alternative to autoawq, or can another alternative be provided
</br></br>
from [Autoawq](https://github.com/casper-hansen/AutoAWQ)
```markdown
Important Notice:
- AutoAWQ is officially deprecated and will no longer be maintained.
- The last tested configuration used Torch 2.6.0 and Transformers 4.51.3.
- If future versions of Transformers break AutoAWQ compatibility, please report the issue to the Transformers project.

Alternative:
- AutoAWQ has been adopted by the vLLM Project: https://github.com/vllm-project/llm-compressor
- MLX-LM now supports AWQ for Mac devices: http://github.com/ml-explore/mlx-lm

For further inquiries, feel free to reach out:
- X: https://x.com/casper_hansen_
- LinkedIn: https://www.linkedin.com/in/casper-hansen-804005170/
```

Comments:
can i work on this?

cc @sunmarc @MekkCyber 

@0O0OwO0O0, auto-awq is not maintained anymore meaning that there will be no official support for newer models when it comes to quantizing the model. 
You can still install `auto-awq` library to run inference with transformers on awq quantized models. As we only support inference with auto-awq, there is nothing that needs to be 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.

Hi, this can be an issue as I got this error while loading qwen3moe awq for SFT.

`ValueError: You current version of `autoawq` does not support module quantization skipping`. Can we support vllm or other method to load awq models?
Fix an invalid condition
Author: cyyever
Pull request: yes

# What does this PR do?

This was detected by ruff.

Comments:
**[For maintainers]** Suggested jobs to run (before merge)

run-slow: align

The docs for this PR live [here](https://moon-ci-docs.huggingface.co/docs/transformers/pr_39762). All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.
Simplify conditional code
Author: cyyever
Pull request: yes

# What does this PR do?

This PR simplifies more `if` conditions and dict `get` code. The changes are part of efforts to finally enable `SIM` checks in `ruff`. 

Comments:
**[For maintainers]** Suggested jobs to run (before merge)

run-slow: align, aria, aya_vision, bark, bert, big_bird, bigbird_pegasus, bit, blip_2, camembert, chameleon, clipseg, colpali, colqwen2, conditional_detr, d_fine

The docs for this PR live [here](https://moon-ci-docs.huggingface.co/docs/transformers/pr_39781). All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.
Fix re-compilations for cross attention cache
Author: zucchini-nlp
Pull request: yes

# What does this PR do?

Fixes https://github.com/huggingface/transformers/issues/39774.

As per title, if we are using the legacy `cache.key_cache[layer_idx]` a warning is emitted and fullgraph compilation breaks. This PR makes sure no warning are raised when using the models in core library

Comments:
**[For maintainers]** Suggested jobs to run (before merge)

run-slow: autoformer, bert, bert_generation, big_bird, bigbird_pegasus, blip, bridgetower, camembert, data2vec, electra, ernie, fsmt, gpt_bigcode, imagegpt, kosmos2, led

The docs for this PR live [here](https://moon-ci-docs.huggingface.co/docs/transformers/pr_39788). All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

No worries, that happens 😄 

Let me see if I can add encoder-decoder compile test easily in this PR or if we need to handle a lot of edge cases

EDIT: oh these aren't generative models/can't compile fullgraph and we don't have graph-break test for those models yet. That's why it wasn't caught in CI
Update mT5 model card
Author: dross20
Pull request: yes

# What does this PR do?
This PR replaces the mT5 model card with a new model card matching the format introduced in #36979.

## Before submitting
- [x] This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).

## Who can review?
@stevhliu

## Notes
- I left out the "Resources" section since I couldn't find any learning materials associated with this model.


Comments:
> Super clean, thanks!

No problem, thank you for the suggestions! 😁

I just applied your feedback, should be ready to go! @stevhliu 

The docs for this PR live [here](https://moon-ci-docs.huggingface.co/docs/transformers/pr_39702). All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.
fix chameleonvision UT failure
Author: yao-matrix
Pull request: yes

as discussed in https://github.com/huggingface/diffusers/pull/11690,  ut `pytest -rA tests/models/chameleon/test_modeling_chameleon.py::ChameleonVision2SeqModelTest::test_model_parallel_beam_search` w/ 2 cards, the error log is "RuntimeError: Expected all tensors to be on the same device, but found at least two devices,src/transformers/models/chameleon/modeling_chameleon.py", the reason is even residual is in the same device as hidden_states at the beginning, but after they went through some operators as both input and output, they finally placed to different device, but when they come to + which is not a nn.Module(so accelerate cannot pre-hook it), error happens. 

so, update `no_split_modules` in `ChameleonVQVAE` to avoid it. @SunMarc, pls help review, thx.


Comments:
The docs for this PR live [here](https://moon-ci-docs.huggingface.co/docs/transformers/pr_39646). All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

**[For maintainers]** Suggested jobs to run (before merge)

run-slow: chameleon
🌐[i18n-bn] Introduce Bengali version of Transformers documentation
Author: ankitdutta428
Pull request: yes

# What does this PR do?

This PR adds a new Bengali localization section to the documentation of the Transformers library.

- Introduces a new folder: `docs/source/bn/`
- Adds a localized file: `index.md` providing an introduction to the Transformers library in Bengali
- Adds a new file: `i18n/README_bn.md` to guide Bengali-speaking users with general information about the library

This is part of an effort to make the Hugging Face documentation more accessible to Bengali-speaking developers, researchers, and learners.

<!-- Remove if not applicable -->
Fixes: [#39705](https://github.com/huggingface/transformers/issues/39705)

## 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#create-a-pull-request), 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?

## Who can review?

Tagging @stevhliu  for documentation-related review.  
Any contributor interested in localization or multilingual documentation is welcome to review as well.



Comments:
Thanks for your interest in translating the docs! It looks like you may be translating an older version of `index.md` and `README.md`. This should be updated to match the latest version on `main`. Also, you'll need to find a Bengali reader who can review your translation as I cannot read it!

You also need to include the Bengali language code [here](https://github.com/huggingface/transformers/blob/c4e20698985887215f7e91a02621265f047af2d7/.github/workflows/build_documentation.yml#L19) and to build the docs in your language!

Hi I have started to work on the newer versions and will translate them in a few days. I will also add the bengali code in the documentation as instructed. As for the bengali reviewer, do they need to satisfy some requirements before they can satisfy the requirements. I currently do not have any bengali reviewers here on github so if could suggest what to do in this case it would have been a great help. Thank you.


There aren't any specific requirements for the reviewer as long as they can understand the translated content and that it makes sense. I would ask on the Hub or Discord to see if anyone is interested in helping out! 🤗 

Okay thank you, that will be a great help. Also can I ask some of the people I know who also know Bengali to review my translated documentation here?
update ernie model card
Author: jzhang533
Pull request: yes

# What does this PR do?

Replaced the previous model card for ERNIE by the standardized model card introduced in issue https://github.com/huggingface/transformers/issues/36979

Links to recent introduced ERNIE 4.5 and ERNIE 4.5 MOE models are also added in this model card.

## 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#create-a-pull-request),
      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).
- [x] Did you write any new necessary tests?


## Who can review?

@stevhliu 


Comments:
The docs for this PR live [here](https://moon-ci-docs.huggingface.co/docs/transformers/pr_39657). All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.
fix: providing a tensor to cache_position in model.generate kwargs always crashes because of boolean test
Author: gante
Pull request: yes

# What does this PR do?

copy of #39261 -- see the discussion there for more references

(I did a bad force push and bricked the PR 🤔 )

Comments:
The docs for this PR live [here](https://moon-ci-docs.huggingface.co/docs/transformers/pr_39300). All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

**[For maintainers]** Suggested jobs to run (before merge)

run-slow: dia, kosmos2, kyutai_speech_to_text, t5gemma
[Model] Cohere2 Vision
Author: zucchini-nlp
Pull request: yes

# What does this PR do?

Add new model

A few unrelated but needed changes:
- Cache in multi-GPU wasn't working, needed to fix `layer_device_map` and `model.get_decoder()`
- The token isn't passed when downloading additional chat templates
- The new `check_outputs` don't work with VLMs because we don't know what type of LM backbone a model uses. So we just check if the module names overlap

Comments:
The docs for this PR live [here](https://moon-ci-docs.huggingface.co/docs/transformers/pr_39810). All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

**[For maintainers]** Suggested jobs to run (before merge)

run-slow: aria, auto, aya_vision, cohere2_vision, got_ocr2, internvl, llava, mistral3, perception_lm, vipllava
Update documentation for Cohere2Vision models
Author: kyle-cohere
Pull request: yes

# What does this PR do?

Update the documentation to include an example of using Cohere Command A Vision in a pipeline, and add it to the list of vision models.

## Before submitting
- [x] This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).


## Who can review?

@zucchini-nlp 


Comments:
**[For maintainers]** Suggested jobs to run (before merge)

run-slow: auto

Can you run `make style`?

Yep, done. Thanks @zucchini-nlp 

The docs for this PR live [here](https://moon-ci-docs.huggingface.co/docs/transformers/pr_39817). All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.