noamaanMulla-03/transformers-issues huggingface dataset:
🌐 [i18n-KO] Translated `main_classes/backbones.md` to Korean
Author: nevertmr
Pull request: yes

# What does this PR do?

Translated the `main_classes/backbones.md` file of the documentation to Korean.
Thank you in advance for your review.

Part of https://github.com/huggingface/transformers/issues/20179

## Before reviewing
- [x] Check for missing / redundant translations (번역 누락/중복 검사)
- [x] Grammar Check (맞춤법 검사)
- [x] Review or Add new terms to glossary (용어 확인 및 추가)
- [x] Check Inline TOC (e.g. `[[lowercased-header]]`)
- [x] Check live-preview for gotchas (live-preview로 정상작동 확인)

## Who can review? (Initial)

May you please review this PR?
@jungnerd, @chelsseeey, @skwh54, @amo33, @maximizemaxwell, @D15M4S
@harheem
@4N3MONE 
@yijun-lee 

## 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? (Final)
<!-- @stevhliu May you please review this PR? -->

Comments:
This PR re-translates the previously deprecated Korean backbone documentation (#39714) and incorporates community feedback to unify the "backbone" terminology. After discussion about inconsistent translations(TTA terminology using "기간", glossary using "기반", and tech blogs using "백본"), we've used to "백본" for better clarity and consistency. The markdown formatting issues from the previous PR comments have also been addressed for better readability.

LGTM! 👍
Adding Support for Qwen3-Next
Author: bozheng-hit
Pull request: yes

# Adding Support for Qwen3-Next
This PR adds the support of codes for the upcoming Qwen3-Next models. For information about Qwen, please visit:
👉 https://github.com/QwenLM/Qwen3

Special thanks to @Cyrilvallez and @ArthurZucker for their valuable feedback and thorough review of this PR!

Comments:
run-slow: qwen3_next

This comment contains run-slow, running the specified jobs: 

models: ['models/qwen3_next']
quantizations: [] ...

run-slow: qwen3_next

This comment contains run-slow, running the specified jobs: 

models: ['models/qwen3_next']
quantizations: [] ...

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

run-slow: auto, qwen3_next

All good! Merging!

Hi @bozheng-hit , you mentioned it has high inference throughput, but currently the MoE layer in transformers is slow. Do you plan to replace the MoE layer with a fused kernel, like GPT-OSS did?

When will it come out? It's nowhere yet


Efficient MoEs are planned for all moes in transformers ! 🤗
Different outputs between using input_embeds and using input_ids
Author: HCRTY
Pull request: no

I trained qwen2.5 with a TTS task. When I do inference, I tried 2 different input type: input_ids and input_embeds. However, I got different outputs from the same model. I wonder whether this is expected?

Comments:
Hi, I’ve also encountered this issue while fine-tuning Qwen2.5 for a TTS task. I noticed the same behavior: input_ids and inputs_embeds give different outputs unless positional embeddings and attention masks are explicitly aligned.

I’d like to work on this and help investigate/fix it. Could you please assign this issue to me, or let me know if there are any specific guidelines I should follow to contribute a PR?

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

We don't do issue assignment, but if you think there's a bug feel free to submit a PR!

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.
[WIP] Add: `ModernVBert`
Author: paultltc
Pull request: yes

# What does this PR do?

## 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?
- [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).
- [x] Did you write any new necessary tests?

## Multimodal Model Addition Checklist

Please ensure your PR completes all following items. See the [full checklist](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md#vision-language-model-contribution-checklist) for details.

- [x] **Modular file**: `modular_<model_name>.py` implemented and verified with `python utils/modular_model_converter.py <model_name>`
- [x] **Fast image processor**: Implemented using `BaseImageProcessorFast` (see [#36978](https://github.com/huggingface/transformers/issues/36978))
- [ ] **Conversion script**: `convert_<model_name>_to_hf.py` added with usage examples
- [ ] **Integration tests**: End-to-end tests with exact output matching (text or logits)
- [ ] **Documentation**: Model docs added/updated in `docs/source/en/model_doc/`
- [x] **Pattern reuse**: Verified against similar models (LLaVA, Idefics2, etc.)
- [ ] **Quality checks**: `make fixup` passes with no errors


## 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.

@yonigozlan (still draft PR as need to be tested, I will notify you when it's ready! 🤗 )

Comments:
Fix `detectron2` installation in docker files
Author: ydshieh
Pull request: yes

# What does this PR do?

See the issue reported in https://github.com/facebookresearch/detectron2/issues/5495

`--no-build-isolation` fixes the issue.

Merge directly.

The effect is demonstrated in https://github.com/huggingface/transformers/actions/runs/19012508548

Comments:
@copilot Please let me know your opinion on the changes

@ydshieh I've opened a new pull request, #41976, to work on those changes. Once the pull request is ready, I'll request review from you.
[WIP] Fix detectron2 installation in docker files
Author: Copilot
Pull request: yes

Thanks for the feedback on #41975. I've created this new PR, which merges into #41975, to address your comment. I will work on the changes and keep this PR's description up to date as I make progress.

Original PR: #41975
Triggering comment (https://github.com/huggingface/transformers/pull/41975#issuecomment-3477956882):
> @copilot Please let me know your opinion on the changes


<!-- START COPILOT CODING AGENT TIPS -->
---

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more [Copilot coding agent tips](https://gh.io/copilot-coding-agent-tips) in the docs.

Comments:
@copilot you are not making any change, why did you even open this pull request?



@copilot Please answer my question!
Fix `autoawq[kernels]` installation in quantization docker file
Author: ydshieh
Pull request: yes

# What does this PR do?

Same as #41975 but for `autoawq[kernels]`.

Merge directly.

The effect :

before this PR: https://github.com/huggingface/transformers/actions/runs/19015759405
after this PR: https://github.com/huggingface/transformers/actions/runs/19014860804

cc @MekkCyber 

Comments:
The docs for this PR live [here](https://moon-ci-docs.huggingface.co/docs/transformers/pr_41978). All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.
a small bug in qwen3_moe
Author: shiwanghua
Pull request: no
Labels: name: bug

### System Info

https://github.com/huggingface/transformers/blob/cbb290ec23ccd9b5c1d1ff4d333477449891debb/src/transformers/models/qwen3_moe/modular_qwen3_moe.py#L106

The names of the first and second variables should be exchanged:

```
top_x, idx = torch.where(expert_mask[expert_idx].squeeze(0))
```

In the subsequent code, replace the topk with idx and vice versa.


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

wrong name meaning

### Expected behavior

change the codes

Comments:
<img width="1214" height="303" alt="Image" src="https://github.com/user-attachments/assets/3dd81877-ca96-4550-9124-681812c1dcdf" />

This line of code best should be modified to:
```
current_state = hidden_states[top_x, :]
```

By deepseek:

<img width="628" height="601" alt="Image" src="https://github.com/user-attachments/assets/f6809708-ed0a-4176-b504-d45f1190b571" />

cc @arthurzucker for MoE!

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.

still needs to be addressed
change `dataloader_persistent_workers` default value to `True`
Author: farbodbj
Pull request: no

https://github.com/huggingface/transformers/blob/82eb67e62a0a66b46647ff4132c173d2f3b8b54f/src/transformers/training_args.py#L1339

As described in the documentation, setting this configuration to `True` will cause training speedup but will cause more RAM usage, and the default is set to True. 
I believe this configuration should default to `True` for two reasons:
1- Recreation of workers while training, bottlenecks the GPU and causes significant slowdown, potentially doubling the training time (benchmarked on a single A100 fine-tuning whisper-large-v3)
2- In case practitioners want to mitigate this slowdown, which is visible by the square-wave pattern in the GPU utilization, they have to go through a lot of configuration and perform many hours of time-consuming tests

I request changing the default value of `dataloader_persistent_workers` to True
If the maintainers of this repo are OK with this decision i will submit the PR promptly

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.

@gante I figured I would ping a contributer, this issue seems to have been ignored

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.

@farbodbj 👋 

my apologies, I'm not the right person to ping for trainer-related stuff :) pinging the actual maintainer: @SunMarc 

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.
feat: add fallback to slow tokenizer when `use_fast=True` in AutoTokenizer fails at runtime
Author: m-misiura
Pull request: yes

# What does this PR do?

This PR adds graceful fallback to slow tokenizers when `AutoTokenizer.from_pretrained()` with `use_fast=True` fails at runtime. Subsequently, this PR should improve robustness issue in tokenizer loading

## Problem

Currently, when `use_fast=True` is specified but the fast tokenizer fails to load due to runtime errors (corrupted files, missing dependencies, file permissions, etc.), the exception propagates and crashes the application. This forces users to implement defensive try-catch wrappers in production code, e.g. see this [PR](https://github.com/trustyai-explainability/guardrails-detectors/pull/56)

## Solution

Wraps fast tokenizer instantiation in a try-except block that:

- attempts to load the fast tokenizer when requested
- falls back to the slow tokenizer if loading fails (with a warning)
- re-raises the exception if no slow tokenizer is available (prevents silent failures)

## 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.

Library:

- tokenizers: @ArthurZucker and @itazap
- model loading (from pretrained, etc): @CyrilVallez


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

run-slow: auto

Hi, this probably won't be accepted, unfortunately! We're currently in the process of a [massive tokenizer refactor](https://github.com/huggingface/transformers/pull/40936) that should make it obsolete. Thank you for the PR, though, and hopefully this doesn't discourage you from making more in future!

> Hi, this probably won't be accepted, unfortunately! We're currently in the process of a [massive tokenizer refactor](https://github.com/huggingface/transformers/pull/40936) that should make it obsolete. Thank you for the PR, though, and hopefully this doesn't discourage you from making more in future!

Great to know that the refactor is under way :)
Use indices as position_ids in modernebert
Author: remi-or
Pull request: yes

Currently there is an issue in `modernbert` stemming from #39847 : the `rotary_emb` always passes `position_ids` as if it were a tensor, but when the implementation is flash it can be `None`. To avoid the error `None has no attributes .shape` we use `indices` as the `positions_ids` in the rotary embedding. 
 

Comments:
The docs for this PR live [here](https://moon-ci-docs.huggingface.co/docs/transformers/pr_41789). 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: modernbert

run-slow: modernbert

This comment contains `run-slow`, running the specified jobs: 

models: ["models/modernbert"]
quantizations: []

## CI Results
[Workflow Run ⚙️](https://github.com/huggingface/transformers/actions/runs/19031596619)

✅ No failing test specific to this PR 🎉 !
test tensor parallel: make tests for dense model more robust
Author: 3outeille
Pull request: yes

Previous tests were not robust enough. New changes tests:

- Non tp model against TP model (both eval-train) in forward/ forward + backward
- Non tp model against TP model (both eval-train) in forward + compile

Comments:
The docs for this PR live [here](https://moon-ci-docs.huggingface.co/docs/transformers/pr_41968). 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: fastspeech2_conformer, parakeet
fix: dict[RopeParameters] to dict[str, RopeParameters]
Author: RyanMullins
Pull request: yes

# What does this PR do?

I noticed in https://github.com/huggingface/transformers/pull/41934 that the type hint for the `Gemma3TextConfig.rope_parameters` was incorrect: it was specified as `dict[RopeParameters]` (which fully evaluates to `dict[RopeParameters, Any]`) but functions like [`modeling_rope_utils.standardize_rope_params()`](https://github.com/huggingface/transformers/blob/90d1b67db1ecf15a631b8020d412bfbee2f0206c/src/transformers/modeling_rope_utils.py#L30) produce either a singular `RopeParameters` dictionary _or_ a `dict[str, RopeParameters]` where the keys of the dictionary are the different attention types, leading to issues with static type checking.

This PR corrects all `PreTrainedConfig.rope_parameters: Optional[RopeParameters | dict[RopeParameters]] = None` type hints in the `/models` directory to be `Optional[RopeParameters | dict[str, RopeParameters]] = None` to align with the data structures returned and consumed elsewhere in the Transformers API.

I'm also considering additional PRs to 1) add or improve type hints in `modeling_rope_utils` and 2) loosen up the type checking on `RopeParameters` by setting [`total=False`](https://docs.python.org/3/library/typing.html#typing.TypedDict) and using the [`Required` type annotation](https://docs.python.org/3/library/typing.html#typing.Required). Will move these into an issue shortly but happy to hear feedback here, too. 


## 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.
- [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?

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.

cc/ @Rocketknight1 @zucchini-nlp

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

run-slow: arcee, aria, bitnet, blt, chameleon, cohere, cohere2, csm, dbrx, deepseek_v2, deepseek_v3, diffllama, doge, dots1, ernie4_5, ernie4_5_moe

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

# What does this PR do?

The `torchcodec` version is not bind automatically to `torch` version during the installation. Currently we get `torch 2.8` (as we pin it) and `torchcodec 0.8.1` (which is for `torch 2.9`).

This PR follows #41892 to allow specifying `torchcodec` version.

Previously, the quantization jobs fails 

https://github.com/huggingface/transformers/actions/runs/18862400780/job/53850645716

Comments:
The docs for this PR live [here](https://moon-ci-docs.huggingface.co/docs/transformers/pr_41988). All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.
docs: improve EncoderDecoderModel docs (fixes #16135)
Author: Arcanixhades0
Pull request: yes
Labels: name: Code agent slop

# What does this PR do?

This PR improves the documentation for `EncoderDecoderModel`.

- Added a short example showing how to create an EncoderDecoderModel using `from_encoder_decoder_pretrained()`
- Added a section on fine-tuning the model with `Seq2SeqTrainer`
- Added a warning about ensuring correct configuration values between encoder and decoder (as mentioned in #15479)

Fixes #16135


Comments:
Hi @Rocketknight1,
Thanks for reviewing! Could you please clarify what needs to be changed to align this with the documentation format?
I made this update based on issue #16135 to improve EncoderDecoderModel docs, but I’d be happy to adjust it as per the repo standards.
🌐 [i18n-KO] Translated `fp_quant` to Korean
Author: maximizemaxwell
Pull request: yes

# What does this PR do?

Translated the `fp_quant.md` file of the documentation to Korean.
Thank you in advance for your review.

Part of https://github.com/huggingface/transformers/issues/20179

## Before reviewing
- [X] Check for missing / redundant translations (번역 누락/중복 검사)
- [X] Grammar Check (맞춤법 검사)
- [X] Review or Add new terms to glossary (용어 확인 및 추가)
- [X] Check Inline TOC (e.g. `[[lowercased-header]]`)
- [X] Check live-preview for gotchas (live-preview로 정상작동 확인)

## Who can review? (Initial)
<!-- 1. 위 체크가 모두 완료된 뒤에만 KREW 팀원들에게 리뷰를 요청하는 아래 주석을 노출해주세요!-->
May you please review this PR?
@jungnerd, @luckyvickyricky, @chelsseeey, @amo33, @skwh54 , @D15M4S

## 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? (Final)
<!-- 2. KREW 팀원들의 리뷰가 끝난 후에 아래 주석을 노출해주세요! -->
<!-- @stevhliu May you please review this PR? -->

Comments:
[kernels] Add Tests & CI for kernels
Author: MekkCyber
Pull request: yes

# What does this PR do?

Adds tests for kernels, and proper daily CI, and slack notifications

run example : https://github.com/huggingface/transformers/actions/runs/18688016017/job/53285883834

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