noamaanMulla-03/transformers-issues huggingface dataset:
Fix typo in chat template example
Author: ericwinsor-aisi
Pull request: yes

# What does this PR do?

This PR fixes a typo in the first example jinja chat template. The template was missing a ' mark so attempting to use it in code causes a jinja syntax error.

## 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#create-a-pull-request),
      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?

@stevhliu

Comments:
The docs for this PR live [here](https://moon-ci-docs.huggingface.co/docs/transformers/pr_35250). All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.
Run model as compressed/uncompressed mode
Author: xkazuka
Pull request: yes

# What does this PR do?
Loading quantized model using compressed-tensors is currently hardcoded to run in `run_compressed` mode. 
This PR allows the model to be loaded in different ways


```python3

from transformers import AutoModelForCausalLM, AutoConfig
from transformers.utils.quantization_config import CompressedTensorsConfig

pretrained_model_name_or_path = "neuralmagic/Llama-3.2-11B-Vision-Instruct-FP8-dynamic" # static config file

quantization_config = CompressedTensorsConfig(run_compressed=False)
model = AutoModelForCausalLM.from_pretrained(
    pretrained_model_name_or_path,
    quantization_config=quantization_config
)

```


Comments:
cc @SunMarc @MekkCyber for quantization

PR is in a decent state to review. Will add tests for it to be finalized

@SunMarc 
Hey Marc, this PR is ready

> re: offline discussion check if the warnings we're seeing on this branch are specific to an uncompressed model vs compressed model

Ok this is addressed now - warning came from not calling apply_quantization_config which populates the scales and zp to state dicts. 

@SunMarc 
PR comments are addressed, let me know if there are more to address!

@ArthurZucker 
Could I get a review please!

@ArthurZucker 
Could I get a review please!

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

# What does this PR do?

skip Fuyu model from `test_prompt_lookup_decoding_matches_greedy_search` to fix `tests_generate`'s failure.

## Backgrounds
Recently, `test_generate` in CircleCI fails due to FuyuModelTest.
([reference] [tests_generate](https://app.circleci.com/pipelines/github/huggingface/transformers/113356/workflows/1e152e04-8f26-496a-9925-549ac7435e88/jobs/1514539?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-checks-link&utm_content=summary) - Failed)

The direct cause is `RuntimeError: The size of tensor a (2) must match the size of tensor b (0) at non-singleton dimension 1`, perhaps caused by `eos_token_id should consist of positive integers, but is tensor([-1]). Your generation will not stop until the maximum length is reached. Depending on other flags, it may even crash.` 


## 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#create-a-pull-request),
      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.

- generate: @zucchini-nlp


Comments:
cc @ydshieh 

- The failure of `tests_torch` will be resolved in this PR: https://github.com/huggingface/transformers/pull/35249

Fuyu skips the other assisted decoding methods due to specific way inputs have to be handled, afaik. So I'll be ok with skipping it, if @ydshieh agrees
Use `rsfE` with `pytest`
Author: ydshieh
Pull request: yes

# What does this PR do?

> parse_pytest_errors_output (in `.circleci/parse_test_outputs.py`)

requires `rsfE` flag in `pytest`


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

merged as approved by Arthur offline
Update AMD docker image (rocm 6.1)
Author: ivarflakstad
Pull request: yes

# What does this PR do?

There is a bug in the 6.0 rocm ubuntu image that causes `rocm-smi` to hang. This PR fixes that by updated the transformers-pytorch-amd-gpu image to use rocm 6.1 as the base image as well as aligning the torch wheel index accordingly.
The PR also adds `nvidia-ml-py` to the exclusion list specific to the AMD image.

Image has been tested on MI250


## Why 6.1?
6.3 seemed to be working fine, but the wheel index is not available yet.
6.2 introduced bugs related to multi-gpu, which is out of the scope of the current work effort.

Comments:
merge as this is AMD-only docker file

The docs for this PR live [here](https://moon-ci-docs.huggingface.co/docs/transformers/pr_35259). All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.
Fix Typos in Audio Classification Documentation
Author: Uvi-12
Pull request: no

Typos to be fixed:
- "The MInDS-14 dataset has a sampling rate of 8000khz (you can find this information in it's dataset card)"- Correct "it's" to "its" (possessive form) and fix "khz" to "kHz" for proper capitalization.
- "The only required parameter is output_dir which specifies where to save your model." (Add a comma for grammatical correctness)


Comments:
Fix FSDP no longer working
Author: muellerzr
Pull request: yes
Labels: name: bug

# What does this PR do?

https://github.com/huggingface/transformers/pull/34140 introduced a breaking change that users are reporting has many downstream issues:

* https://github.com/huggingface/peft/issues/2205
* https://github.com/axolotl-ai-cloud/axolotl/issues/2149

This PR reverts the breaking logic, while also maintaining the original test the user intended, in such a way that doesn't break downstream code. I'd highly recommend a patch with this fix @ArthurZucker 

Fixes https://github.com/huggingface/peft/issues/2205
Fixes https://github.com/axolotl-ai-cloud/axolotl/issues/2149


## 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#create-a-pull-request),
      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.

@ArthurZucker @winglian @SunMarc @BenjaminBossan 

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

Failures are unrelated!
gpt2: enable model_parallel for xpu backend
Author: dvrogozh
Pull request: yes

For: #35252
CC: @ArthurZucker @SunMarc

Comments:
This seems sporadic ci failure unrelated to PR:
```
FAILED tests/utils/test_modeling_utils.py::ModelUtilsTest::test_from_pretrained_low_cpu_mem_usage_equal - AssertionError: 424.6015625 != 426.8125 within 2 delta (2.2109375 difference) : using `low_cpu_mem_usage` should incur the same memory usage in both cases.
```

> Hey! Thanks, these functions are completely deprecated and the recommended API is to use accelerate's device_map = "auto" instead!

Thank you for you feedback. I saw deprecation warnings and that's why I implemented this only for one model :). @ArthurZucker : I am trying to make ci passing clean for XPU backend. I totally understand if maintainers want to avoid changing deprecated stuff which will be dropped at some point. However I would like to raise a question on what can be done for the sake of clean ci? If decision is (and your reply hints it is) to not enable model_parallel for other non-CUDA backends, then associated tests should probably be marked as CUDA specific and excluded for non-CUDA. If that's the direction - I will submit another PR to mark these tests as CUDA specific.


Let's mark these tests as cuda specific. Thanks for your contribution!

> Let's mark these tests as cuda specific. Thanks for your contribution!

Will do. Thank you for guidance!

I've submitted #35269 to mark tests with `@require_torch_gpu`.
Fix type hints for apply_chat_template
Author: Rocketknight1
Pull request: yes

As @qgallouedec and @august-murr pointed out in https://github.com/huggingface/trl/pull/2455, the type hints for `apply_chat_template` are incorrect. Tools can be passed as `Callable` functions as well as JSON schema `dict` and this is documented [here](https://huggingface.co/docs/transformers/main/en/chat_templating#understanding-tool-schemas).

This PR corrects the type hints to follow the documentation/code!

Comments:
The docs for this PR live [here](https://moon-ci-docs.huggingface.co/docs/transformers/pr_35216). All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.
Fix seamless TTS generate
Author: ylacombe
Pull request: yes
Labels: name: run-slow

Fix #34811

cc @ydshieh 

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

let me check with the pipeline test - it's where I found this issue.

it works now! Could you remove 2 lines below: `# TODO` and `@run_test_using_subprocess` before merge? Thanks

tests/pipelines/test_pipelines_text_to_audio.py
```
    # TODO: @ylacombe: `SeamlessM4TForTextToSpeech.generate` has issue with `generation_config`. See issue #34811
    @slow
    @require_torch
    @run_test_using_subprocess
    def test_medium_seamless_m4t_pt(self):
```

I've removed the TODO!

You can ignore 

> tests/models/seamless_m4t_v2/test_modeling_seamless_m4t_v2.py::SeamlessM4Tv2ModelWithSpeechInputTest::test_retain_grad_hidden_states_attentions

failing on multi-gpu runner.
Fix CI
Author: Cyrilvallez
Pull request: yes

https://github.com/huggingface/transformers/pull/34858 modified Llama, but Aria relying on Llama got merged in the meantime. This correctly reapplies modular to Aria (order of RotaryEmbedding got changed because now the Attention does not need it anymore, thus it got closer to the class actually needing it)


Comments:
We probably also need to check how `check_modular_conversion` works to avoid it passes on PR but fail on main. But that could be in another PR and by me or anyone wants to work on it.

BTW, it's always a good idea to trigger a slow CI :-)

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

Humm, it seems very tricky to always avoid race conditions, it would probably require some check at merge time 🤔 I thought about this becoming an issue as we scale modular, but this is already an issue with the "copied from" (except if there is additional CI magic for copied from?). Here's the scenario:
- last commit on https://github.com/huggingface/transformers/pull/34858 pass all CIs as it should
- In the meantime, https://github.com/huggingface/transformers/pull/34157 is merged, relying on actual library version of Llama (not the modified one in https://github.com/huggingface/transformers/pull/34858)
- https://github.com/huggingface/transformers/pull/34858 is approved and merged (without any new commits, thus no new CI check)
- As Llama was modified in https://github.com/huggingface/transformers/pull/34858, Aria version is not longer up-to-date

@Cyrilvallez Thanks for explaining. Yes, this happens from time to time. There is `Update branch` button, but click it all the time is also frustrating. We will try to think of solutions.
Cleanup: continue the init refactor
Author: LysandreJik
Pull request: yes


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

failed test is irrelevant and already addressed in another PR (not merged)
Corrected typo in agent system prompts
Author: Uvi-12
Pull request: yes

Fixes #35109 

This PR corrects the typos in prompts.py for 'acces' and 'those', to 'access' and 'these'.

@stevhliu

Comments:
The docs for this PR live [here](https://moon-ci-docs.huggingface.co/docs/transformers/pr_35143). All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.
Update I-JEPA checkpoints path
Author: qubvel
Pull request: yes

# What does this PR do?

Updates checkpoints path for I-JEPA model

## 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.

Comments:
The docs for this PR live [here](https://moon-ci-docs.huggingface.co/docs/transformers/pr_35120). All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.
[docs] top_p, top_k, temperature docstrings
Author: stevhliu
Pull request: yes

Fixes #35045 by clarifying that the `top_p`, `top_k` and `temperature` values are derived from a models generation config file, otherwise the default values are used.

Comments:
The docs for this PR live [here](https://moon-ci-docs.huggingface.co/docs/transformers/pr_35065). All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.
[docs] Update Python version in translations
Author: jla524
Pull request: yes

# What does this PR do?

updates python version to 3.9 in all translations


## 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?
- [ ] 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?

@stevhliu

Comments:
The docs for this PR live [here](https://moon-ci-docs.huggingface.co/docs/transformers/pr_35096). All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.
[i18n-Chinese] Translating perf_train_cpu.md to Chinese
Author: asdkfjsd
Pull request: yes

# What does this PR do?

I have translated `docs/source/zh/perf_train_cpu.md` to Chinese. Please let me know if there are any corrections. Thank you very much!
<!-- Remove if not applicable -->

Fixed issue: [i18n-Chinese] Translating perf_train_cpu.md to Chinese #35230
URL : [https://github.com/huggingface/transformers/issues/35230](url)


## 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?
- [ ] 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?

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:
Hello, I've completed a Chinese translation and would greatly appreciate it if you could take a moment to review it for me.  @Isotr0py Thank you very much!

The docs for this PR live [here](https://moon-ci-docs.huggingface.co/docs/transformers/pr_35242). All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.
ValueError: You are trying to save a non-contiguous tensor in MT5 finetunning
Author: esti-tech
Pull request: no
Labels: name: Need more information

https://github.com/huggingface/transformers/blob/7bbc62474391aff64f63fcc064c975752d1fa4de/src/transformers/trainer.py#L3728


may be using these fixes it
```py

 for param in model.parameters():
        if not param.is_contiguous():
            param.data = param.data.contiguous()

```

Comments:
Hey @esti-tech, could you please provide a reproducible code example and error so that we may see how to best help?

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.
Add Flax diverse group search
Author: sanchit-gandhi
Pull request: no
Labels: name: Good Second Issue

name: Flax

### Feature request

Add diverse beam search decoding to Flax, an "alternative to BS that decodes a list of diverse outputs by optimising for a diversity-augmented objective", as described in the paper: https://arxiv.org/pdf/1610.02424.pdf 

This feature would mimic the PyTorch equivalent, added in #9006.

@yeandy made a great start on adding this feature in the PR #24508. The PR is still open, and anyone in the community is free to pick-up the PR and see it through to completion!

### Motivation

There's a promising PR for this feature that is partway there - it would be a shame not to see this through to completion!

### Your contribution

Happy to answer any questions/queries on the PR and provide PR reviews 🤗 Think this would be a fun one for any Flax contributors who are interested!

Comments:
Hey @sanchit-gandhi, can I continue the PR? I don't have experience writing with Flax though so let me know if you expect a very quick turnaround time for this PR!
But if that's not a roadblock then I'd be interested to contribute.

Hey @chiral-carbon! There's no time pressure for this, so feel free to pick it up if you're interested! Would be a fun first Transformers Flax contribution

@sanchit-gandhi thanks! In that case I would love to pick it up 👍

Awesome! Feel free to continue the PR or open a new one!

Hi @sanchit-gandhi , is this issue still open?


@csking101 I didn't end up doing anything here so feel free to take over if it is open


@chiral-carbon Sure, I will take this up, thank you!