noamaanMulla-03/transformers-issues huggingface dataset:
Fix case where `_LazyAutoMapping.register` is passed a `str` key
Author: hmellor
Pull request: yes

<!-- ci-dashboard-badge:start -->
[![CI](https://transformers-ci.lor-e.huggingface.cool/badge/pr?pr=47148)](https://transformers-ci.lor-e.huggingface.cool/d/pytest-observability-by-pr/pytest-observability-branch?var-pr=47148)
<!-- ci-dashboard-badge:end -->

Downstream users of the auto classes register classes using `str` keys (i.e. model type). https://github.com/huggingface/transformers/pull/46876 added an early exit that causes all downstream usage like this to fail with `AttributeError: 'str' object has no attribute '__module__'`.

This PR adds a `getattr` so that downstream usage of `_LazyAutoMapping.register` is not broken.

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

run-slow: auto

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

<!-- ci-dashboard-recap:start -->

---

### CI recap

**Dashboard:** [View test results in Grafana](https://transformers-ci.lor-e.huggingface.cool/d/pytest-observability-by-pr/pytest-observability-branch?var-pr=47148)
**Latest run:** [28893516277:1](https://github.com/huggingface/transformers/actions/runs/28893516277)
**Result:** `failure` | **Jobs:** 15 | **Tests:** 172,739 | **Failures:** 1 | **Duration:** 22h 19m

<!-- ci-dashboard-recap:end -->
Extend continuous batching memory prediction test to XPU
Author: sywangyi
Pull request: yes

<!-- ci-dashboard-badge:start -->
[![CI](https://transformers-ci.lor-e.huggingface.cool/badge/pr?pr=47159)](https://transformers-ci.lor-e.huggingface.cool/d/pytest-observability-by-pr/pytest-observability-branch?var-pr=47159)
<!-- ci-dashboard-badge:end -->

- Intel XPU: @IlyasMoutawwakil

pytest -q tests/generation/test_continuous_batching.py::TestMemoryHandlerPrediction

5 passed

Comments:
<!-- ci-dashboard-recap:start -->

---

### CI recap

**Dashboard:** [View test results in Grafana](https://transformers-ci.lor-e.huggingface.cool/d/pytest-observability-by-pr/pytest-observability-branch?var-pr=47159)
**Latest run:** [28922220143:2](https://github.com/huggingface/transformers/actions/runs/28922220143)
**Result:** `success` | **Jobs:** 3 | **Tests:** 144 | **Failures:** 0 | **Duration:** 1m 55s

<!-- ci-dashboard-recap:end -->

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

<!-- ci-dashboard-badge:start -->
[![CI](https://transformers-ci.lor-e.huggingface.cool/badge/pr?pr=47137)](https://transformers-ci.lor-e.huggingface.cool/d/pytest-observability-by-pr/pytest-observability-branch?var-pr=47137)
<!-- ci-dashboard-badge:end -->

Solve the problem

Comments:
<!-- ci-dashboard-recap:start -->

---

### CI recap

**Dashboard:** [View test results in Grafana](https://transformers-ci.lor-e.huggingface.cool/d/pytest-observability-by-pr/pytest-observability-branch?var-pr=47137)
**Latest run:** [28932160005:2](https://github.com/huggingface/transformers/actions/runs/28933020257)
**Result:** `failure` | **Jobs:** 2 | **Tests:** 21 | **Failures:** 1 | **Duration:** 2m 0s

> **Code quality check failed**: test jobs were skipped. Fix the code quality issues and push again to run tests.

<!-- ci-dashboard-recap:end -->
Fix RT-DETR v2 converter for current model keys
Author: IMvision12
Pull request: yes

<!-- ci-dashboard-badge:start -->
[![CI](https://transformers-ci.lor-e.huggingface.cool/badge/pr?pr=47129)](https://transformers-ci.lor-e.huggingface.cool/d/pytest-observability-by-pr/pytest-observability-branch?var-pr=47129)
<!-- ci-dashboard-badge:end -->

Fixes the RT-DETR v2 conversion script by updating stale key mappings to match the current HF model structure and adding support for the missing `rtdetr_v2_r50vd_m` checkpoint.

The converter now maps encoder keys to `model.encoder.aifi`, maps attention output projections to `o_proj`, maps feed-forward layers to `mlp.fc1` / `mlp.fc2`, and uses `config.d_model` instead of a hard-coded hidden size when splitting decoder QKV weights.

Also adds verification slices for `rtdetr_v2_r50vd_m`.

Verified locally that all supported variants convert successfully:

```text
rtdetr_v2_r18vd
rtdetr_v2_r34vd
rtdetr_v2_r50vd_m
rtdetr_v2_r50vd
rtdetr_v2_r101vd
```

@Rocketknight1 

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

run-slow: rt_detr_v2

<!-- ci-dashboard-recap:start -->

---

### CI recap

**Dashboard:** [View test results in Grafana](https://transformers-ci.lor-e.huggingface.cool/d/pytest-observability-by-pr/pytest-observability-branch?var-pr=47129)
**Latest run:** [28854590340](https://github.com/huggingface/transformers/actions/runs/28854590340)
**Result:** `success` | Grafana metrics are not available yet.

<!-- ci-dashboard-recap:end -->

cc @nielsrogge @molbap
Command allowlist bypass via $(...) command substitution under ALLOW_SHELL_OPERATORS=true
Author: geo-chen
Pull request: no
Labels: name: bug

### System Info

Hi, I've reported this on 8 June 2026 to huntr as guided in the security.md policy but have not gotten any response since: https://huntr.com/bounties/589e980e-cb15-4087-b1b3-d7d6ad2c0a15

can i share details here?

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

-

### Expected behavior

-

Comments:
[docs] MoE decode switching
Author: stevhliu
Pull request: yes

<!-- ci-dashboard-badge:start -->
[![CI](https://transformers-ci.lor-e.huggingface.cool/badge/pr?pr=47149)](https://transformers-ci.lor-e.huggingface.cool/d/pytest-observability-by-pr/pytest-observability-branch?var-pr=47149)
<!-- ci-dashboard-badge:end -->

Adds docs for #47107

- Adds some docs to clarify that when you switch from `grouped_mm` to `batched_mm`, it also applies to any sub-config backbone and not just the top-level model.
- Adds brief mention of `get_experts_implementation` which naturally complements `set_experts_implementation`

Comments:
<!-- ci-dashboard-recap:start -->

---

### CI recap

**Dashboard:** [View test results in Grafana](https://transformers-ci.lor-e.huggingface.cool/d/pytest-observability-by-pr/pytest-observability-branch?var-pr=47149)
**Latest run:** [28897609272](https://github.com/huggingface/transformers/actions/runs/28897609272)
**Result:** `success` | Grafana metrics are not available yet.

<!-- ci-dashboard-recap:end -->

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

<!-- ci-dashboard-badge:start -->
[![CI](https://transformers-ci.lor-e.huggingface.cool/badge/pr?pr=47114)](https://transformers-ci.lor-e.huggingface.cool/d/pytest-observability-by-pr/pytest-observability-branch?var-pr=47114)
<!-- ci-dashboard-badge:end -->

Adds docs for https://github.com/huggingface/transformers/pull/46876

- explain how custom code models are detected and that they don't inherit a conversion mapping
- explain how to register custom code model so that they do inherit a conversion mapping

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

<!-- ci-dashboard-recap:start -->

---

### CI recap

**Dashboard:** [View test results in Grafana](https://transformers-ci.lor-e.huggingface.cool/d/pytest-observability-by-pr/pytest-observability-branch?var-pr=47114)
**Latest run:** [28811591643:1](https://github.com/huggingface/transformers/actions/runs/28953685943)
**Result:** `success` | **Jobs:** 2 | **Tests:** 24 | **Failures:** 0 | **Duration:** 15s

<!-- ci-dashboard-recap:end -->
Don't crash the ASR pipeline when an installed torchcodec cannot be imported
Author: evnsnclr
Pull request: yes

<!-- ci-dashboard-badge:start -->
[![CI](https://transformers-ci.lor-e.huggingface.cool/badge/pr?pr=47071)](https://transformers-ci.lor-e.huggingface.cool/d/pytest-observability-by-pr/pytest-observability-branch?var-pr=47071)
<!-- ci-dashboard-badge:end -->

# What does this PR do?

Fixes #47070

`AutomaticSpeechRecognitionPipeline.preprocess` imports torchcodec whenever the package is installed:

```python
if is_torchcodec_available():
    import torchcodec
```

`is_torchcodec_available()` is a package-metadata check, not an importability check. torchcodec wheels are binary-tied to a specific torch/FFmpeg but declare no torch requirement in their metadata, so resolvers routinely produce installed-but-unimportable combinations (e.g. `torch==2.10.0` + `torchcodec==0.14.0`, a pairing pip/uv will create today via `pyannote-audio` → `torchcodec`). The bare import then raises `OSError` and crashes **every** pipeline call — including plain file-path, array, and `{"raw": ...}` inputs that never needed torchcodec, since the file-path branch decodes with `ffmpeg_read`.

This PR wraps the import in `try/except (ImportError, OSError)`: on failure, torchcodec is treated as unavailable with a one-time warning, and only `torchcodec.decoders.AudioDecoder` inputs lose support (they would fail to exist anyway). No behavior change for healthy installs.

Real-world impact example: this failure mode currently breaks 100% of fresh installs of `insanely-fast-whisper` (worked around downstream in Vaibhavs10/insanely-fast-whisper#283).

Includes a regression test that simulates a broken torchcodec via a meta-path finder raising `OSError`, with `is_torchcodec_available` patched to `True`, and asserts the pipeline still transcribes a plain numpy waveform.

## Before submitting
- [x] Did you read the [contributor guideline](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md#create-a-pull-request)?
- [x] Was this discussed/approved via a Github issue? → #47070
- [x] Did you write any new necessary tests?

## Who can review?

Pipelines: @Rocketknight1

Comments:
<!-- ci-dashboard-recap:start -->

---

### CI recap

**Dashboard:** [View test results in Grafana](https://transformers-ci.lor-e.huggingface.cool/d/pytest-observability-by-pr/pytest-observability-branch?var-pr=47071)
**Latest run:** [28711995835:2](https://github.com/huggingface/transformers/actions/runs/28711995835)
**Result:** `failure` | **Jobs:** 15 | **Tests:** 171,258 | **Failures:** 6 | **Duration:** 21h 27m

<!-- ci-dashboard-recap:end -->

The failing `tests_non_model [shard 0/8]` job looks like CI infrastructure rather than a test failure — the job annotations show `Executing the custom container implementation failed. Please contact your self hosted runner administrator.` before any tests ran, and shards 1–7 of the same suite passed. A re-run should clear it whenever someone with access has a moment.

I don't think we want to monkey-patch the codebase to work around your broken environment, I'm sorry!

No worries
Fix custom code which doesn't know about the new linear layer type names
Author: hmellor
Pull request: yes

<!-- ci-dashboard-badge:start -->
[![CI](https://transformers-ci.lor-e.huggingface.cool/badge/pr?pr=47174)](https://transformers-ci.lor-e.huggingface.cool/d/pytest-observability-by-pr/pytest-observability-branch?var-pr=47174)
<!-- ci-dashboard-badge:end -->

Custom models which use linear attention will be using the old names. These models were created before `remap_legacy_layer_types` and so none of them will call it.

This PR makes `remap_legacy_layer_types` automatic for custom code models, while keeping it opt-in for non-custom models.

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

<!-- ci-dashboard-recap:start -->

---

### CI recap

**Dashboard:** [View test results in Grafana](https://transformers-ci.lor-e.huggingface.cool/d/pytest-observability-by-pr/pytest-observability-branch?var-pr=47174)
**Latest run:** [28949888867:1](https://github.com/huggingface/transformers/actions/runs/28949888867)
**Result:** `success` | **Jobs:** 13 | **Tests:** 172,594 | **Failures:** 0 | **Duration:** 19h 56m

<!-- ci-dashboard-recap:end -->

Thanks! These are exact copies of the methods on `PreTrainedModel`. I figured it was better do add proper methods rather than use magic strings in other methods
Allow metal-flash-sdpa for OpenAIPrivacyFilter on MPS
Author: ArthurZucker
Pull request: yes

Adds `kernels-community/metal-flash-sdpa` to `OpenAIPrivacyFilter._compatible_flash_implementations`, enabling the sliding-window + attention-sink flash path on MPS instead of the eager fallback. Requires metal-flash-sdpa PR #5 (window + s_aux). Validated: cos 0.997, argmax 100%.

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

run-slow: openai_privacy_filter

**CI Dashboard:** [View test results in Grafana](https://transformers-ci.lor-e.huggingface.cool/d/pytest-observability-by-pr/pytest-observability-branch?var-pr=46740)
🌐 [i18n-KO] Translate accelerator_selection.md to Korean
Author: kkwjk2718
Pull request: yes

<!-- ci-dashboard-badge:start -->
[![CI](https://transformers-ci.lor-e.huggingface.cool/badge/pr?pr=47157)](https://transformers-ci.lor-e.huggingface.cool/d/pytest-observability-by-pr/pytest-observability-branch?var-pr=47157)
<!-- ci-dashboard-badge:end -->

﻿## Summary

- Updated the Korean `accelerator_selection.md` page from the current English docs.
- Replaced the old GPU-only content with the current accelerator selection content for CUDA and Intel XPU.
- Updated the Korean ToC title for `accelerator_selection`.

## Validation

- Checked that obsolete text such as `TODO`, `GPU 선택하기`, and the old `CUDA_DEVICE_ORDER` sentence is removed.
- Checked that required environment variables and doc-builder tags/code fences are preserved.
- Ran `git diff --check upstream/main..HEAD -- docs/source/ko/accelerator_selection.md docs/source/ko/_toctree.yml`.

Related to #20179

Reviewers: @ArthurZucker @sgugger @eunseojo @jungnerd

Comments:
cc @stevhliu

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

<!-- ci-dashboard-recap:start -->

---

### CI recap

**Dashboard:** [View test results in Grafana](https://transformers-ci.lor-e.huggingface.cool/d/pytest-observability-by-pr/pytest-observability-branch?var-pr=47157)
**Latest run:** [28980193132:2](https://github.com/huggingface/transformers/actions/runs/28980193132)
**Result:** `success` | **Jobs:** 2 | **Tests:** 24 | **Failures:** 0 | **Duration:** 1m 49s

<!-- ci-dashboard-recap:end -->
[i18n-KO] Translate optimum.md to Korean and fix Furiosa typo
Author: kkwjk2718
Pull request: yes

<!-- ci-dashboard-badge:start -->
[![CI](https://transformers-ci.lor-e.huggingface.cool/badge/pr?pr=47156)](https://transformers-ci.lor-e.huggingface.cool/d/pytest-observability-by-pr/pytest-observability-branch?var-pr=47156)
<!-- ci-dashboard-badge:end -->

## What changed

- Added Korean translation for `docs/source/ko/quantization/optimum.md`.
- Linked the Korean Optimum page from `docs/source/ko/_toctree.yml`.
- Fixed a typo in the English source: `Furiousa` -> `Furiosa`.

## Why

This contributes to the Korean documentation translation effort for Transformers quantization docs.

## Validation

- Ran `git diff --check`.

Comments:
cc @stevhliu 

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

<!-- ci-dashboard-recap:start -->

---

### CI recap

**Dashboard:** [View test results in Grafana](https://transformers-ci.lor-e.huggingface.cool/d/pytest-observability-by-pr/pytest-observability-branch?var-pr=47156)
**Latest run:** [28980134526:2](https://github.com/huggingface/transformers/actions/runs/28980134526)
**Result:** `success` | **Jobs:** 2 | **Tests:** 24 | **Failures:** 0 | **Duration:** 1m 48s

<!-- ci-dashboard-recap:end -->
[serge] integration failure triage - 2026-07-07
Author: github-actions[bot]
Pull request: no

<!-- serge-triage-run:integration-failure-triage:2026-07-07 -->

Automated **integration-failure triage** for the daily CI window `2026-07-01 → 2026-07-07`.

This issue was generated by AI-assisted automation. The grouping, summaries, and recommended follow-up can be incomplete or misleading; verify the failures before acting.

Serge dispatched one task per failure group below — each opens or updates its own PR on a `serge/fix/itf-<fingerprint>` branch. This table is refreshed in place as Serge runs: a group links its `#<pr>` when opened, shows `🚫 no fix` when Serge found no safe change, `⚠️ task failed` on error, or `(pending)` while still running (a late PR links on the next nightly run).

## Dispatched failure groups

| Model | Error | Occurrences | PR |
| --- | --- | --- | --- |
| `whisper` | other — other (20), shape/size mismatch (2) | 22 | `serge/fix/itf-cb0ec086dc28` (pending) |
| `whisper` | output_mismatch — list output differs (10), other (6), tensor values differ (4) | 20 | `serge/fix/itf-5fadcce436e9` (pending) |
| `musicgen_melody` | output_mismatch — tensor values differ (16) | 16 | 🚫 no fix |
| `gemma` | output_mismatch — list output differs (14) | 14 | 🚫 no fix |
| `dac` | output_mismatch — tensor values differ (6), other (6) | 12 | 🚫 no fix |
| `edgetam` | import_or_config — other (12) | 12 | #47122 |
| `glm46v` | other — other (12) | 12 | 🚫 no fix |
| `minimax_m3_vl` | load_error — other (12) | 12 | #47123 |
| `diffusion_gemma` | output_mismatch — tensor values differ (6), list output differs (4) | 10 | 🚫 no fix |
| `gemma3` | output_mismatch — list output differs (8), other (2) | 10 | 🚫 no fix |
| `gemma3n` | output_mismatch — list output differs (10) | 10 | 🚫 no fix |
| `glm_ocr` | output_mismatch — list output differs (10) | 10 | 🚫 no fix |
| `deepseek_v32` | load_error — other (8) | 8 | 🚫 no fix |
| `falcon_mamba` | output_mismatch — other (6), list output differs (2) | 8 | #47124 |
| `grounding_dino` | output_mismatch — tensor values differ (6), other (2) | 8 | 🚫 no fix |
| `higgs_audio_v2` | output_mismatch — tensor values differ (8) | 8 | 🚫 no fix |
| `mllama` | output_mismatch — other (8) | 8 | 🚫 no fix |
| `moshi` | output_mismatch — other (8) | 8 | 🚫 no fix |
| `mpt` | other — other (8) | 8 | 🚫 no fix |
| `peft_integration` | other — other (8) | 8 | 🚫 no fix |

_Generated 2026-07-08T00:44:36+00:00._

Comments:
Superseded by #47182 — closing this stale nightly integration-failure triage issue. Open PRs stay linked from the current issue.
Fix experts implementation in two spots
Author: remi-or
Pull request: yes

<!-- ci-dashboard-badge:start -->
[![CI](https://transformers-ci.lor-e.huggingface.cool/badge/pr?pr=47097)](https://transformers-ci.lor-e.huggingface.cool/d/pytest-observability-by-pr/pytest-observability-branch?var-pr=47097)
<!-- ci-dashboard-badge:end -->

This PR fixes one potential bug and one regression:
- in the main generate loop, the context manager `_optimize_model_for_decode` is entered / exited for every single token generated, rather than wrapping the decode as a whole. This PR fixes that: it leads to improvements for small MoEs like Qwen3-Omni-30B thinker (+5.2% eager on B200)
- in `_optimize_model_for_decode` the entirety of the model is walked, which can lead to a bug in multimodal models. If there is a model with an MoE text model and an image model with no MoE, the model enters the `set_experts_implementation` function and starts iterating on all submodules, regardless of whether or not they `_can_set_experts_implementation`. On exit, for the vision submodules, the context manager tries to restore a non-existent experts implementation, falling back to `grouped_mm`. This calls `_grouped_mm_can_dispatch` and it crashes because `_can_set_experts_implementation` is false. This PR fixes that by skipping submodules where `_can_set_experts_implementation` is False, and since that function is expensive to call, we add a cached flag on the class when can the method successfully runs. Same for the attn setter.

Results: for models like Llava with a MoE text model and a non-MoE vision encoder, no more crashes. For tiny MoEs: better perf.

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

<!-- ci-dashboard-recap:start -->

---

### CI recap

**Dashboard:** [View test results in Grafana](https://transformers-ci.lor-e.huggingface.cool/d/pytest-observability-by-pr/pytest-observability-branch?var-pr=47097)
**Latest run:** [28984296541:1](https://github.com/huggingface/transformers/actions/runs/28984296541)
**Result:** `success` | **Jobs:** 15 | **Tests:** 170,109 | **Failures:** 0 | **Duration:** 19h 9m

<!-- ci-dashboard-recap:end -->
Add native FSDP2 module + migration
Author: 3outeille
Pull request: yes

<!-- ci-dashboard-badge:start -->
[![CI](https://transformers-ci.lor-e.huggingface.cool/badge/pr?pr=46707)](https://transformers-ci.lor-e.huggingface.cool/d/pytest-observability-by-pr/pytest-observability-branch?var-pr=46707)
<!-- ci-dashboard-badge:end -->

https://github.com/huggingface/transformers/pull/46705

applying FSDP + test_fsdp_mixin.py will be added in PR https://github.com/huggingface/transformers/pull/46990

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

<!-- ci-dashboard-recap:start -->

---

### CI recap

**Dashboard:** [View test results in Grafana](https://transformers-ci.lor-e.huggingface.cool/d/pytest-observability-by-pr/pytest-observability-branch?var-pr=46707)
**Latest run:** [28984042525:1](https://github.com/huggingface/transformers/actions/runs/28984042525)
**Result:** `success` | **Jobs:** 15 | **Tests:** 166,226 | **Failures:** 0 | **Duration:** 18h 45m

<!-- ci-dashboard-recap:end -->