add-or-fix-type-checking

修复由 ty、make typing 或 make check-repo 检测到的类型检查错误。适用于在本地运行、CI 或 PR 日志中出现类型错误时使用。

仓库最近推送
GitHub Stars
169,342
Forks
35,255
Issues / PRs
382

预览截图

来自skillπ 实验室的展示

安装方式

先用 Prompt 核对来源与依赖。也可下载安装包。

用 AI 助手安装

复制提示词,让助手先核对固定版本和依赖。

查看 Prompt收起 Prompt
先检查当前 Agent 是否已安装 SkillPI Skill Finder。如果尚未安装,请按官方仓库的说明安装并启用:https://github.com/Findskills/skillpi。然后使用 Skill Finder 打开此 SkillPI 详情页并定位 "add-or-fix-type-checking":https://skillpi.com/zh/skills/deepskill-9bfd474288f7e28ed75fbed691cdf8e8a1285738becb24866da220aae5577943。安装前核对上游来源和版本:https://github.com/huggingface/transformers。来源不一致时停止并说明差异。核对通过后,用 Skill Finder 安装目标 Skill,并报告安装路径和来源版本。

来源与配置

github.com

配置方式待核实

请查看原始来源中的适用工具、依赖和权限要求。

安装实测待补充

修复由 ty、make typing 或 make check-repo 检测到的类型检查错误。适用于在本地运行、CI 或 PR 日志中出现类型错误时使用。

0 下载

介绍来源: third_party · huggingface · 0.0.1 参考来源

SkillPi 解读

能完成的任务
修复被ty检测到的破损的打字检查,制作打字,或制作检查-repo. 当输入错误出现在本地运行、 CI 或 PR 日志中时使用 。
适合谁
来源文档未说明。
输入和输出
`<target>` : 模块或目录用于类型检查(如果知道的话). 可选 `make typing` 或显示输入失败的 CI 输出。
软件、账号及付费要求
来源文档未说明。
限制与区别
来源文档未说明。
实测状态
未测试

文件浏览

在原站浏览文件 ↗

原始 SKILL.md

打开原文 ↗
Frontmatter
name: add-or-fix-type-checking
description: Fixes broken typing checks detected by ty, make typing, or make check-repo. Use when typing errors appear in local runs, CI, or PR logs.

Add Or Fix Type Checking

Input

  • <target>: module or directory to type-check (if known).
  • Optional make typing or CI output showing typing failures.

Workflow

  1. Identify scope from the failing run:

    • If you already have make typing or CI output, extract the failing file/module paths.
    • If not, run:
      make typing
    • Choose the narrowest target that covers the failures.
  2. Run ty check for the target to get a focused baseline:

    ty check --respect-ignore-files --exclude '**/*_pb*' <target>
  3. Triage errors by category before fixing anything:

    • Wrong/missing type annotations on signatures
    • Attribute access on union types (for example X | None)
    • Functions returning broad unions (for example str | list | BatchEncoding)
    • Mixin/protocol self-type issues
    • Dynamic attributes on objects or modules
    • Third-party stub gaps (missing kwargs, missing __version__, etc.)
  4. Apply fixes using this priority order (simplest first):

    a. Narrow unions with isinstance() / if x is None / hasattr(). This is the primary tool for resolving union-type errors. ty narrows through all of these patterns, including the negative forms:

       # Narrow X | None — use `if ...: raise`, never `assert`
       if x is None:
           raise ValueError("x must not be None")
       x.method()  # ty knows x is X here
    
       # Narrow str | UploadFile
       if isinstance(field, str):
           raise TypeError("Expected file upload, got string")
       await field.read()  # ty knows field is UploadFile here
    
       # Narrow broad union parameters early in a function body
       # (common for methods accepting e.g. list | dict | BatchEncoding)
       if isinstance(encoded_inputs, (list, tuple)):
           raise TypeError("Expected a mapping, got sequence")
       encoded_inputs.keys()  # ty sees only the dict/mapping types now

    b. Use local variables to help ty track narrowing across closures. When self.x is X | None and you need to pass it to nested functions or closures, ty cannot track that self.x stays non-None. Copy to a local variable and narrow the local:

       manager = self.batching_manager
       if manager is None:
           raise RuntimeError("Manager not initialized")
       # Use `manager` (not `self.batching_manager`) in nested functions

    c. Split chained calls when the intermediate type is a broad union. If func().method() fails because func() returns a union, split it:

       # BAD: ty can't narrow through chained calls
       result = func(return_dict=True).to(device)["input_ids"]
    
       # GOOD: split, narrow, then chain
       result = func(return_dict=True)
       if not hasattr(result, "to"):
           raise TypeError("Expected dict-like result")
       inputs = result.to(device)["input_ids"]

    d. Fix incorrect type hints at the source. If a parameter is typed X | None but can never be None when actually called, remove None from the hint.

    e. Annotate untyped attributes. Add type annotations to instance variables set in __init__ or elsewhere (for example self.foo: list[int] = []). Declare class-level attributes that are set dynamically later (for example _cache: Cache, _token_tensor: torch.Tensor | None).

    f. Use @overload for methods with input-dependent return types. When a method returns different types based on the input type (e.g. __getitem__ with str vs int keys), use @overload to declare each signature separately:

       from typing import overload
    
       @overload
       def __getitem__(self, item: str) -> ValueType: ...
       @overload
       def __getitem__(self, item: int) -> EncodingType: ...
       @overload
       def __getitem__(self, item: slice) -> dict[str, ValueType]: ...
    
       def __getitem__(self, item: int | str | slice) -> ValueType | EncodingType | dict[str, ValueType]:
           ...  # actual implementation

    This eliminates cast() calls at usage sites by giving the checker precise return types for each call pattern.

    g. Make container classes generic to propagate value types. When a class like UserDict holds values whose type changes after transformation (e.g. lists → tensors after .to()), make the class generic so methods can return narrowed types:

       from typing import Generic, overload
       from typing_extensions import TypeVar
    
       _V = TypeVar("_V", default=Any)  # default=Any keeps existing code working
    
       class MyDict(UserDict, Generic[_V]):
           @overload
           def __getitem__(self, item: str) -> _V: ...
           # ...
    
           def to(self, device) -> MyDict[torch.Tensor]:
               # after .to(), values are tensors
               ...
               return self  # type: ignore[return-value]

    The default=Any (from typing_extensions) means unparameterized usage like MyDict() stays MyDict[Any] — no existing code needs to change. Only methods that narrow the value type (like .to()) declare a specific return type. This eliminates cast() at all call sites.

    h. Use self: "ProtocolType" for mixins. When a mixin accesses attributes from its host class, define a Protocol in src/transformers/_typing.py and annotate self on methods that need it. Apply this consistently to all methods in the mixin. Import under TYPE_CHECKING to avoid circular imports.

    i. Use TypeGuard functions for dynamic module attributes (for example torch.npu, torch.xpu, torch.compiler). Instead of getattr(torch, "npu") or hasattr(torch, "npu") and torch.npu.is_available(), define a type guard function in src/transformers/_typing.py:

       def has_torch_npu(mod: ModuleType) -> TypeGuard[Any]:
           return hasattr(mod, "npu") and mod.npu.is_available()

    Then use it as a narrowing check: if has_torch_npu(torch): torch.npu.device_count(). After the guard, ty treats the module as Any, allowing attribute access without getattr() or cast(). See existing guards in _typing.py for all device backends.

    Key rules for type guards:

    • Use TypeGuard[Any] (not a Protocol) — this is the simplest form that works with ty and avoids losing the original module's known attributes.
    • The guard function must be called directly in an if condition for narrowing to work. ty does NOT narrow through and conditions or if not guard: return.
    • Import guards with from .._typing import has_torch_xxx (not via module attribute _typing.has_torch_xxx) — ty only resolves TypeGuard from direct imports.

    j. Use getattr() / setattr() for dynamic model/config attributes. For runtime-injected fields (for example config/model flags), use getattr(obj, "field", default) for reads and setattr(obj, "field", value) for writes. Also use getattr() for third-party packages missing type stubs (for example getattr(safetensors, "__version__", "unknown")). Avoid getattr(torch, "npu") style — use type guards instead (see above).

    k. Use cast() as a last resort before # type: ignore. Use when you've structurally validated the type but the checker can't see it: pattern-matched AST nodes, known-typed dict values, or validated API responses.

       # After structural validation confirms the type:
       stmt = cast(cst.Assign, node.body[0])
       annotations = cast(list[Annotation], [])

    Do not use cast() for module attribute narrowing — use type guards. Do not use cast() when @overload or generics can solve it at the source.

    l. Use # type: ignore only for third-party stub defects. This means cases where the third-party package's type stubs are wrong or incomplete and there is no way to narrow or cast around it. Examples:

    • A kwarg that exists at runtime but is missing from the stubs
    • A method that exists but isn't declared in the stubs Always add the specific error code: # type: ignore[call-arg], not bare # type: ignore.
  5. Things to never do:

    • Never use assert for type narrowing. Asserts are stripped by python -O and must not be relied on for correctness. Use if ...: raise instead.
    • Never use # type: ignore as a first resort. Exhaust all approaches above first.
    • Do not use getattr(torch, "backend") to access dynamic device backends (npu, xpu, hpu, musa, mlu, neuron, compiler) — use type guards
    • Do not use cast() for module attribute narrowing — use type guards
    • Do not use cast() when @overload or generics can eliminate it at the source
    • Do not add helper methods or abstractions just to satisfy the type checker (especially for only 1-2 occurrences)
    • Do not pollute base classes with domain-specific fields; use Protocols
    • Do not add if x is not None guards for values guaranteed non-None by the call chain; fix the annotation instead
    • Do not use conditional inheritance patterns; annotate self instead
  6. Organization:

    • Keep shared Protocols and type aliases in src/transformers/_typing.py
    • Import type-only symbols under if TYPE_CHECKING: to avoid circular deps
    • Use from __future__ import annotations for PEP 604 syntax (X | Y)
  7. Verify and close the PR loop:

    • Re-run ty check on the same <target>
    • Re-run make typing to confirm the type/model-rules step passes
    • If working toward merge readiness, run make check-repo
    • Ensure runtime behavior did not change and run relevant tests
  8. Update CI coverage when adding new typed areas:

    • Update ty_check_dirs in Makefile to include newly type-checked directories.

版本历史

  1. v5.24.1 GitHub ↗
    原版更新说明

    # Patch release v5.24.1 A patch to fix a bunch of stuff for vLLM, a few distributed issues, and some model fixes (llama4, dory); see the full list ### vLLM related - Fix backward compatibility of the cache rename for remote code (#51085) by @hmellor - Restore modeling_attn_mask_utils for remote code (one-off to unblock vLLM) (#51124) by @hmellor - Expose past_key_values in MBartDecoderLayer.forward signature for remote code (#51177) by @hmellor - [OmniASR] Support a padding_mask kept on the CPU in the audio encoder (#51100) by @El-euchidali ### Model fixes - Fix Llama4 forward crash on missing image_outputs (#51144) by @kylesayrs - Fix dory static cache (#50993) by @ArthurZucker ### Distributed - Allow expert parallelism alone with tp_plan={} (#50996) by @3outeille - Fix strided checkpoint reads on PyTorch 2.9 (#51042) by @satsuki2486441738 **Full Changelog**: https://github.com/huggingface/transformers/compare/v5.24.0...v5.24.1

  2. v5.24.0 GitHub ↗
    原版更新说明

    # Release v5.24.0 ## New Model additions ### Inkling 2 Mini <img width="80%" alt="image" src="https://github.com/user-attachments/assets/beefb5e0-39a9-4205-ab07-0ee707af95f2" /> Inkling 2 Mini is a multimodal model from Thinking Machines Lab that accepts text and image inputs and generates text outputs. It is a smaller sibling of Inkling 2 Small, added in v5.23.0. It has 24 decoder layers instead of 48, and compensates with a looping mechanism in which layers 6 to 17 run three times. A learned message-passing mechanism mixes the residuals of the previous pass into the attention and mixture-of-experts inputs of each loop layer. The decoder has a hidden size of 2304 and routes each token to 8 of 128 experts. The image encoder, tokenizer and processor are the same as Inkling 2 Small's. A research checkpoint ([TML-d24-varloop-research](https://huggingface.co/thinkingmachines/TML-d24-varloop-research)) has the same architecture but supports a variable number of loop passes. Fewer passes are faster, and more passes improve quality. Both checkpoints contain NVFP4 and MXFP8 quantized layers, which are dequantized at load time. **Links:** [Documentation](https://huggingface.co/docs/transformers/main/en/model_doc/inkling2_loop) | [Blog Post](https://thinkingmachines.ai/news/inkling-2-mini/) | [HF Blog Post](https://huggingface.co/blog/inkling2mini) * Add Inkling2 Mini (#51050) by @guarin ### Apertus 1.5 Apertus 1.5 is a multimodal model from the Swiss AI Initiative that accepts text, images and audio and generates text. It extends the Apertus language model with the EMU3.5 vision tokenizer for images and WavTokenizer for audio. The EMU3.5 tokenizer is an image-only VQGAN with the same encoder as Chameleon's, and it assigns codes by the largest inner product with the codebook. The media tokenizers turn images and audio into discrete tokens, which the language backbone processes alongside text in a shared input vocabulary. The output vocabulary contains only text tokens, so image and audio generation are not supported. **Links:** [Documentation](https://huggingface.co/docs/transformers/main/en/model_doc/apertus1p5) * Apertus 1.5: add model (#47662) by @RaphaelKreft ### WavTokenizer WavTokenizer encodes 24 kHz mono audio into discrete tokens using a single codebook, at 40 or 75 tokens per second depending on the checkpoint, and reconstructs audio from those tokens. `WavTokenizerModel` encodes and decodes, and `WavTokenizerEncoderModel` only encodes. Speech, music/audio and unified checkpoints are available. The 40-token-per-second variant is the audio tokenizer of Apertus 1.5. Training the codec is not supported. **Links:** [Documentation](https://huggingface.co/docs/transformers/main/en/model_doc/wavtokenizer) | [Paper](https://huggingface.co/papers/2408.16532) * Apertus 1.5: add model (#47662) by @RaphaelKreft ### Dory Dory is a looped (latent-recurrent) language model from NVIDIA. It uses a normalized-GPT architecture with interleaved sliding-window and full attention layers. A shared block of layers is applied repeatedly, so Dory can spend more compute per token. The loop count can be changed at inference time on the same checkpoint to trade speed against quality. **Links:** [Documentation](https://huggingface.co/docs/transformers/main/en/model_doc/dory) | [Paper (nGPT)](https://huggingface.co/papers/2410.01131) * Add Dory model support (#50099) by @shan18 ### HY4-VL HY4-VL (Hunyuan V4 Vision-Language) combines the HYV4 mixture-of-experts text backbone with a vision encoder for image-text and video-text generation. It supports dynamic-resolution visual inputs and uses multimodal rotary position embeddings (mRoPE) to represent temporal and spatial positions. It builds on the Qwen2-VL design and shares its vision patch merger with HunYuan-VL. **Links:** [Documentation](https://huggingface.co/docs/transformers/main/en/model_doc/hy_v4_vl) * Add HY4-VL (#50877) by @vasqu ### Omnilingual ASR Omnilingual ASR is a suite of multilingual speech-recognition models from Meta FAIR that covers more than 1,600 languages. Each model pairs a Wav2Vec2-style audio encoder with one of two heads: * **CTC** (`OmniASRForCTC`): a linear projection to the vocabulary, decoded non-autoregressively with greedy CTC. * **Audio language model** (`OmniASRForConditionalGeneration`): audio embeddings are projected into a Llama decoder that generates the transcription. It optionally takes a language code (e.g. `"eng_Latn"`), which generally improves transcription quality. Both variants come in 300M, 1B, 3B and 7B sizes. **Links:** [Documentation](https://huggingface.co/docs/transformers/main/en/model_doc/omniasr) | [CTC Documentation](https://huggingface.co/docs/transformers/main/en/model_doc/omniasr_ctc) | [Paper](https://huggingface.co/papers/2511.09690) * Adding Omnilingual ASR models (#43265) by @ebezzam ### Lara Mini Lara Mini is a multilingual base language model from Translated with 7.2B total and 0.6B active parameters per token. It is a hybrid of linear-time recurrent layers, sliding-window attention and a few global attention layers, each followed by a fine-grained mixture of experts. The weights are released under the CC BY-NC-SA 4.0 license (non-commercial use) in a gated repository. **Links:** [Documentation](https://huggingface.co/docs/transformers/main/en/model_doc/lara_mini) | [Paper](https://huggingface.co/papers/2611.16956) * Add Lara Mini (#50819) by @ValeGian ### SarvamMLA SarvamMLA is the architecture of Sarvam-105B, a 105B-parameter mixture-of-experts language model from Sarvam AI. It combines Multi-head Latent Attention (MLA) with sparse MoE routing: 128 routed experts with 8 active per token, plus 1 shared expert. It uses sigmoid routing with group-based top-k selection and YaRN rotary embeddings for contexts up to 131K tokens. The architecture is the same as DeepSeek-V3, with a custom configuration. **Links:** [Documentation](https://huggingface.co/docs/transformers/main/en/model_doc/sarvam_mla) * Add SarvamMLA model (sarvamai/sarvam-105b) (#44569) by @aashay-sarvam ### SarvamMoE SarvamMoE is the architecture of Sarvam-30B, Sarvam AI's 30B-parameter mixture-of-experts model. It uses grouped-query attention with QK normalization, and 128 routed experts with 6 active per token, plus 1 shared expert. The architecture is the same as GLM-4-MoE, so the auto classes load it with the GLM-4-MoE implementation and only `SarvamMoEConfig` is specific to SarvamMoE. **Links:** [Documentation](https://huggingface.co/docs/transformers/main/en/model_doc/sarvam_moe) * Add SarvamMoE (sarvamai/sarvam-30b) (#51023) by @hmellor ### EXAONE EXAONE covers the EXAONE 3.0, EXAONE 3.5 and EXAONE Deep language models from LG AI Research. Their architecture is the same as Llama, so the auto classes load them with `LlamaModel` and `LlamaForCausalLM`, and only `ExaoneConfig` is specific to EXAONE. The released checkpoints are renamed to the Llama names when loading and back when saving, so they no longer need `trust_remote_code=True`. **Links:** [Documentation](https://huggingface.co/docs/transformers/main/en/model_doc/exaone) * Add EXAONE (#50966) by @hmellor ### Model updates * **Ling 3.1 Flash** now loads natively through `BailingHybrid`, like Ling 3.0 in v5.20.0 (#49737) by @icavan * **Beam** gains a `BeamForTokenClassification` head (#50634) by @AymenKallala ## Breaking changes ### Cache renaming: `past_key_values` / `cache_params` → `cache` (#50585, #50730) `past_key_values` and `cache_params` are renamed to `cache` across the library. The old names still work with a deprecation warning; see the dedicated section below. * 🚨🚨 Rename `past_key_values`/`cache_params` to `cache` (#50585) by @Cyrilvallez * Bump minimal peft version for cache name compatibility (#50730) by @Cyrilvallez Attention models used to call their cache `past_key_values`, while Mamba-style and linear-attention models called it `cache_params`. Hybrid models therefore had to juggle two names for the same object. There is now a single name, `cache`, everywhere: model `forward` signatures, `generate`, `prepare_inputs_for_generation`, the masking utilities, and every `ModelOutput`. ```python # Before outputs = model(input_ids, past_key_values=past_key_values, use_cache=True) next_cache = outputs.past_key_values # Now outputs = model(input_ids, cache=cache, use_cache=True) next_cache = outputs.cache ``` * **Fully backward compatible for now**: `past_key_values=` / `cache_params=` are renamed to `cache` automatically, with a one-time deprecation warning. Model `forward` and `prepare_inputs_for_generation` accept the old names until **v5.40.0**, and `generate` accepts them until **v6.0.0**. Passing both an old name and `cache` raises a `ValueError`. * **Outputs too**: `outputs.past_key_values`, `outputs.cache_params` and `outputs["past_key_values"]` still return the cache. Output classes can also still be built with the old field names (e.g. `CausalLMOutputWithPast(past_key_values=...)`), so most remote-code models keep working unchanged. * **Custom code**: models defined outside the library should rename their arguments to `cache`. Layers now call `cache.update(key_states, value_states, layer_idx, kwargs=kwargs)`, so custom `Cache` subclasses that override `update` should accept the extra `kwargs` argument. 🚨 `peft>=0.22.0` is now required. 📚 Docs: <https://huggingface.co/docs/transformers/main/en/kv_cache> ### Multimodal Outputs Generative multimodal models now return shared output classes (`MultimodalBaseModelOutputWithPast`, `MultimodalCausalLMOutputWithPast`, and their MoE variants) instead of one output class per model. Code that checks for a model-specific output class should switch to these. * 🚨 Multimodal Model Output for generative LMs (#50379) by @zucchini-nlp `modeling_attn_mask_utils.py` has been removed. Every function in it had been deprecated in favor of `transformers.masking_utils`. Remote-code models that still import `_prepare_4d_causal_attention_mask` or `AttentionMaskConverter` from it must move to `transformers.masking_utils`. ### Other things * Remove deprecated and unused older mask API file (#50728) by @Cyrilvallez LayoutLMv3 (and the PP-DocLayoutV2 reading-order model that shares its code) now go through the attention interface, so SDPA and flex attention are supported. The relative position bias is built once per forward pass and passed to attention as `position_bias`. * 🚨 LayoutLMv3: support SDPA through the attention interface, build the relative position bias once (#50688) by @14H034160212 ## Cache Beyond the rename, this release adds static-cache support to assisted decoding and fixes `generate` with flex attention and a static cache. `StaticCache` now allocates values with the value states' dtype, and the cache is kept under activation checkpointing when gradients are off. The `is_linear` / `is_croppable` properties are fixed for hybrid linear/full-attention models, BigBird block-sparse decoding works with a KV cache, and KV sharing is restored for the Gemma 4 assistants. * Support static cache in assisted decoding (#49415) by @jiqing-feng * Simplify cache handling in generate (#50910) by @Cyrilvallez * Fix generate with flex attention and a static cache (#50864) by @tarekziade * Allocate the StaticCache values with the value states' dtype (#49554) by @qgallouedec * Keep the cache under activation checkpointing when gradients are off (#50890) by @qgallouedec * [cache] Fix is_linear property to correctly remove hybrid layers (#51030) by @Cyrilvallez * Fix is_croppable property for mixed linear-full attention classes (#51028) by @Cyrilvallez * Fix BigBird block-sparse decoding with a KV cache (#49984) by @jiqing-feng * fix(gemma4): Restore KV sharing for the Gemma 4 assistants and their targets (#50531) by @harshaljanjani * Fix Dory vocabulary resizing, loop validation, and last-loop static caching (#50982) by @shan18 * Fix device placement in `test_bc_cache_name_{forward,generate}` (#50757) by @ydshieh * Update test_dynamic_cache_hard expected values for A10G (#50822) by @ydshieh ## Generation Generation fixes cover sampled beam search (candidates are sorted again before finalization), constrained sampling (batch IDs are preserved), `generate` on MPS with encoder-decoder models, and `TextStreamer`, which no longer drops spaces or lags on text without spaces such as Chinese, Japanese and Korean. `StopStringCriteria` initializes faster, and its cache now actually hits. * Restore sorting of sampled beam candidates before finalization (#50754) by @BlazeSR10hawk * fix(generate): preserve batch IDs in constrained sampling (#50883) by @BlazeSR10hawk * Fix generate for mps and encoder-decoder models (#51032) by @Cyrilvallez * Fix TextStreamer dropping spaces sometimes (#51036) by @Cyrilvallez * Fix long lagging when streaming text without spaces and NJK chars (#36708) by @CNSeniorious000 * Speed up StopStringCriteria init and fix its cache never hitting (#50780) by @TheNetherWatcher ## Continuous batching Continuous batching now works under `torch.inference_mode()` and finds sharded key/value projections under any decoder path. The per-token memory estimate scales with the TP size, warmup handles async and static inputs correctly, and an out-of-bounds error in the top-k processor is fixed. * [CB] Scale the per-token memory estimate by the TP size (#48566) by @qgallouedec * Continuous batching: find the sharded key/value projections under any decoder path (#50366) by @qgallouedec * Fix continuous batching under torch.inference_mode() (#50863) by @tarekziade * [CB] Re-order the warmup block so async warms both sets of inputs (#50868) by @remi-or * Wait for each warmup forward before the next one rewrites the static inputs (#50353) by @qgallouedec * Fix out-of-bounds error in continuous batching top-k processor (#50282) by @khush-patel-09 * [CB] Replace test prompts with less ambiguous ones (#50876) by @remi-or ## Chat templates, parsing and serving Chat parsing gets a new `python-call-list` content parser, better handling of bare keys and duplicate XML arguments, and three further parser fixes. `apply_chat_template` accepts message objects, and assistant masks are correct with left truncation. `transformers serve` handles a missing Hub cache, lists loaded models in `/v1/models`, keeps local paths containing `@`, and keeps assistant content when `tool_calls` is empty. * [Chat Parsing] Add `python-call-list` content parser (#50619) by @nico-martin * [Chat Parsing] Quote bare keys that have whitespace around them with `unquoted_keys` (#50917) by @gagan-baghel * [Chat Parsing] Preserve array values when merging duplicate XML arguments (#50760) by @crunz-ailab * Fix three chat parsing bugs (#50655) by @Rocketknight1 * Fix apply_chat_template with message objects (#50818) by @Rocketknight1 * Fix assistant tokens mask with left truncation (#50758) by @yibol9768-alt * fix(chat templating): isolate concurrent assistant tracking (#50673) by @BlazeSR10hawk * Just a small improvement in jinja (#50635) by @zucchini-nlp * Accept argument types in parentheses in get_json_schema docstrings (#50745) by @miinimal * [serve] Handle missing Hub cache and include loaded models in /v1/models (#50663) by @RyanMullins * [serve] Preserve local model paths containing '@' in ModelManager (#50662) by @RyanMullins * [serve] Keep assistant content when tool_calls is null or empty (#50707) by @AabhasK ## Pipelines Multimodal pipelines now accept media-only inputs and string assistant prefills, keep Mistral prefills in Voxtral, stop mutating generation kwargs, and return chat messages as `input_text` when returning tensors. `pipeline` also respects a `device_map` that targets a single device. * fix(pipelines): support media-only inputs in AnyToAnyPipeline (#50856) by @BlazeSR10hawk * fix(pipelines): support string assistant prefill in multimodal full-t… (#50679) by @BlazeSR10hawk * fix: preserve Mistral prefill in Voxtral and multimodal pipelines (#50624) by @BlazeSR10hawk * fix(pipelines): avoid mutating multimodal generation kwargs (#50786) by @BlazeSR10hawk * Return the chat messages as input_text when multimodal pipelines return tensors (#50816) by @burrows99 * Fix `pipeline` ignoring `device_map` when it targets a single device (#50645) by @wanhakim ## Vision Vision fixes cover Muse Glimmer's embedding order, GotOCR2 and Emu3 image sizes, Kimi video inputs, NemotronH Omni video forwarding, SAM3 RoPE precision in bf16, and DETR-family configs with `dilation=None`. SigLIP2 and LFM2-VL now process all images at once with tensor ops. Flash Attention is turned off for multimodal models whose image mask it would drop. * Fix Muse Glimmer vision embedding order (#50847) by @sid-rp * Fix GotOCR2 image size (#50810) by @guarin * Fix Emu3 image sizes after channel format conversion (#50615) by @stefanielizeth73-art * Kimi video fix (#50633) by @zucchini-nlp * Fix NemotronH_Omni_Reasoning_V3 video forwarding and MTP vision norm weight conversion (#49839) by @meatybobby * Keep SAM3's RoPE positions in fp32 when loading in bf16 (#50938) by @qgallouedec * Fix loading DETR-family configs that store dilation=None (#50934) by @sibisrinivasb * SigLIP2: compute the position-embedding resize for all images with tensor ops (#50736) by @IlyasMoutawwakil * LFM2-VL: run the projector on all images at once (#50734) by @IlyasMoutawwakil * LFM2-VL: integration expectations after #50734 (A10, MI300X) (#50923) by @IlyasMoutawwakil * Turn off Flash Attention support for multimodal models whose image mask it drops (#50724) by @albertvillanova ## Audio Audio fixes cover the OmniASR CTC blank token, Qwen3 Omni audio kwargs, Qwen3-ASR's `truncation=False` default, PeAudioVideo loading with timm 1.0.31, and the audio training examples. * Fix OmniASR CTC blank token ID (#51040) by @taking-lying-flat * Add missing past_key_values deprecation decorator to OmniASRForCondit… (#50983) by @RyanMullins * Fix Qwen3 Omni audio kwargs forwarding (#50616) by @remote-controlled-man * Restore `truncation=False` default for Qwen3-ASR audio (#50740) by @hmellor * Fixes PeAudioVideo model loading with timm 1.0.31. In that version, t… (#50862) by @sywangyi * FIx audio training examples. (#50672) by @ebezzam ## Quantization Dequantized models are now saved without the quantizer's weight conversions, and the unquantized weights of a dequantized FP8 checkpoint are cast to the model's dtype. The quantization docs also get a standard template for each method. * Save dequantized models without the quantizer's weight conversions (#50271) by @qgallouedec * Cast the unquantized weights of a dequantized FP8 checkpoint to the model's dtype (#50595) by @qgallouedec * Update inkling2 quant config (#50829) by @guarin * [docs] Standard template for quantization methods (#50848) by @stevhliu ## Parallelization FSDP2 modules are resharded before the optimizer is created, pipeline parallelism spreads layers more evenly, and TP sharding of tied weights is fixed. * Reshard FSDP2 modules before creating the optimizer (#50535) by @qgallouedec * [perf] Spread layer over PP more evenly (#50693) by @francesco-bertolotti * Fixes an issue related to TP sharding of tied weights (#50272) by @tengomucho ## Exporters Exported ONNX, OpenVINO and ExecuTorch programs load without `trust_remote_code`. Pickled `.pt2` programs, which can run arbitrary code when loaded, now require `trust_remote_code=True`. * Exporters: ONNX, OpenVINO and ExecuTorch programs load without trust_remote_code (#50886) by @IlyasMoutawwakil * Exporters: require trust_remote_code to load pickled (.pt2) programs (#50813) by @IlyasMoutawwakil * Fix OpenVINO generate export tests for xLSTM and Bark (#50765) by @ydshieh ## Bugfixes and improvements * Skip flaky Kosmos2 `test_generate_from_multimodal_encoder_outputs` (#51049) by @ydshieh * Fix flaky DeepseekV32 / Whisper / HiggsAudioV2 CUDA graph capture failures (GC inside the capture, torch 2.15) (#50899) by @ydshieh * [docs] Fix the custom ResNet example in the customizing models guide (#50999) by @AlexxRussell * [serge] Fix 2 integration tests for model `seamless_m4t_v2` failing with `output_mismatch` (list output differs (2)) (#48553) by @sergereview[bot] * [serge] Fix 2 integration tests for model `videomae` failing with `other` (other (2)) (#49287) by @sergereview[bot] * Always ensure correct dtype for _keep_in_fp32_modules_strict (#50975) by @Cyrilvallez * Fix DataCollatorWithFlattening crash on empty examples (#50984) by @fruitstash * Require transformers-mic 0.1.3 for make run-mic (#51019) by @tarekziade * Dory tests: build the recurrent-layer configs through the model tester (#51000) by @tarekziade * Move older-style testers of 129 more models onto static small-config defaults (#50976) by @tarekziade * Fix UMT5 decoder scaling for untied checkpoints (#50950) by @MonikaDvorackova * Move older-style testers of 123 popular models onto static small-config defaults (#50972) by @tarekziade * Fix typos in the English model and decoding guides (#50974) by @Ultroncn * [serge] Fix 2 integration tests for model `ministral3` failing with `other` (other (2)) (#49336) by @sergereview[bot] * [serge] Fix 2 integration tests for model `regnet` failing with `output_mismatch` (tensor values differ (2)) (#47616) by @sergereview[bot] * [serge] Fix 2 integration tests for model `efficientnet` failing with `output_mismatch` (tensor values differ (2)) (#47840) by @sergereview[bot] * [serge] Fix 2 integration tests for model `pvt_v2` failing with `output_mismatch` (tensor values differ (2)) (#49243) by @sergereview[bot] * Follow the SentencePiece model when converting a bare `tokenizer.model` (#50555) by @hmellor * [serge] Fix 4 integration tests for model `pvt` failing with `output_mismatch` (tensor values differ (4)) (#47750) by @sergereview[bot] * Migrate the remaining 95 testers to static small-config defaults (#50944) by @tarekziade * Migrate testers for 20 popular models to static small-config defaults (#50916) by @tarekziade * Use hf-internal-testing for the tiny Dbrx and Bloom models and the example images (#49993) by @albertvillanova * Return an empty list from batch_decode for an empty batch (#50873) by @zaidwhy * [LFM3] Hub causal-conv1d kernels and packed sequences (#50732) by @paulpak58 * Fix NewTokenizer example in custom tokenizers guide (#50840) by @phatstraws * [Apertus1.5] Add A10G expectations for audio and batch generation integration tests (#50924) by @ydshieh * Check python_multipart before multipart in is_multipart_available (#50664) by @RyanMullins * feat(ci): scan the docker images with Wiz before they are pushed (#49150) by @rtrompier * Remove now useless keys_to_ignore_at_inference in all configs (#50911) by @Cyrilvallez * [SGLang CI] Fix the VLM teardown error on CPU (follow-up of #50913) (#50914) by @ydshieh * Set _skip_keys_device_placement directly inside PreTrainedModel (#50909) by @Cyrilvallez * [SGLang CI] Deselect a GPU-only VLM test (#50913) by @ydshieh * [vLLM CI] Fix the FireRedASR2 and MTP test failures (missing dependency, GPU-only test) (#50912) by @ydshieh * Fix Reformer LM head bias not applied since the weight-loading refactor (#50811) by @ydshieh * Fix error message and remove duplicate code in convert_slow_tokenizer.py (#50077) by @samyuktahegde * Fix first-subword label assignment in LayoutXLM, LayoutLMv2, and MarkupLM tokenizers (#50455) by @14H034160212 * Skip added-token trie scan when no token can match (#50781) by @TheNetherWatcher * [CI report] Upload the vLLM / SGLang CI reports to the Hub and post a summary to Slack (#50896) by @ydshieh * Use lifespan instead of on_event in pipeline web server guide (#50858) by @phatstraws * [CI] docs-check fixes (#50279) by @stevhliu * Expose literal tester overrides and merged small-config defaults (#50462) by @tarekziade * [SGLang CI] Add failure report job (shared with vLLM CI) (#50882) by @ydshieh * [`Apertus 1.5`] Guard behind slow for gated repo (#50884) by @vasqu * avoid running this wf from fork (#50694) by @tarekziade * bench test reproducibility (#50504) by @tarekziade * Fix timestamps (#50503) by @tarekziade * [SGLang CI] Test against the latest published SGLang CPU release (#50878) by @ydshieh * Keep AFMoE expert biases in FP32 on BF16 load (#50687) by @annekethvij * Fix seeded collator generator selection (#50861) by @danarkhipov * Remove no_grad decorator on all _init_weights (#50831) by @Cyrilvallez * Remove no_grad decorator on RoPE forward (#50828) by @Cyrilvallez * Update expected logits slice for `Qwen2MoeIntegrationTest::test_model_a2_7b_logits` on A10G (#50845) by @ydshieh * Check for an empty batch in convert_to_tensors without flattening it (#49942) by @jayzuccarelli * [serge] Fix 2 integration tests for model `qwen2_moe` failing with `other` (other (2)) (#49480) by @sergereview[bot] * [serge] Fix 1 integration test for model `flint` failing with `other`, raising `RuntimeError` (other (1)) (#50283) by @sergereview[bot] * [serge] Fix 5 integration tests for model `qwen3_vl_moe` failing with `other`, raising `RuntimeError` (other (5)) (#50145) by @sergereview[bot] * Fixing training CI again (#50747) by @SunMarc * Fix Mistral Large 4 LeRoPE training gradients (#50727) by @taking-lying-flat * Keep MiMo-V2-Flash's router in float32 in bfloat16 models (#50722) by @francesco-bertolotti * Fix NanoChat inheriting an incompatible rotary kernel (#50823) by @taking-lying-flat * Fix `CwmIntegrationTest` GPU OOM on multi-GPU runners (cap per-GPU `max_memory` at 70%) (#50824) by @ydshieh * Mark `OmDetTurboModelTest::test_batching_equivalence` as flaky (`topk` query selection) (#50815) by @ydshieh * [docs] Fix imports that fail on main in four English docs (#50817) by @burrows99 * Fix duplicate JetMoE router logits in auxiliary loss (#50658) by @taking-lying-flat * docs: updates to security policy in SECURITY.md (#50711) by @Michellehbn * [serge] Fix 2 integration tests for model `utils` failing with `output_mismatch` (list output differs (2)) (#49407) by @sergereview[bot] * Fix OOM in Mamba2IntegrationTest by using MemoryCleanupMixin (#50808) by @ydshieh * [docs] Fix the any-to-any guide example using the removed infer_device (#50792) by @burrows99 * Scale the padding-free position_ids test tolerance to the logits (#50697) by @EvanZhuang * [docs] Fix PairClassificationPipeline example using the removed self.framework (#50789) by @burrows99 * [serge] Fix 2 integration tests for model `hrm_text` failing with `output_mismatch` (tensor values differ (2)) (#50006) by @sergereview[bot] * [serge] Fix 6 integration tests for model `bloom` failing with `output_mismatch` (list output differs (4), other (2)) (#50469) by @sergereview[bot] * [serge] Fix 2 integration tests for model `ministral` failing with `output_mismatch` (tensor values differ (2)) (#50146) by @sergereview[bot] * [serge] Fix 1 integration test for model `deepseek_vl_hybrid` failing with `output_mismatch` (list output differs (1)) (#49581) by @sergereview[bot] * [serge] Fix 2 integration tests for model `ovis2` failing with `output_mismatch` (list output differs (2)) (#50233) by @sergereview[bot] * [docs] Replace examples using pipeline tasks removed in v5 (#50625) by @rickygrosvenor-pramanick * [CI] Fix external links (#50685) by @stevhliu * Update A10 expected outputs of FA2 integration tests (#50738) by @ydshieh * Revert mark linguistic generated (#50735) by @vasqu * Update dev version (#50725) by @vasqu **Full Changelog**: [`v5.23.0...v5.24.0`](https://github.com/huggingface/transformers/compare/v5.23.0...v5.24.0)

  3. v5.23.0 GitHub ↗
    原版更新说明

    # Release v5.23.0 ## New Model additions ### Inkling2 <img width="1200" height="675" alt="image" src="https://github.com/user-attachments/assets/9115e142-1be3-4f79-a51d-ea0e5c25b152" /> Inkling 2 Small is a multimodal model from Thinking Machines Lab that accepts text and image inputs and generates text outputs, and it is intended for use in English and other languages and across multiple coding languages. Its language backbone has 48 mixture-of-experts decoder layers, each routing tokens to 8 of 384 experts, for 594B total and 17B active parameters. It keeps the Inkling decoder (learned relative attention, short causal convolutions, mixture-of-experts layers) and adds block attention residuals, gated attention with a learned sink, and dynamic key/value convolutions. Images are encoded by a Perception Encoder-based vision transformer and projected into the language model embeddings, one embedding per 40x40 pixel patch. **Links:** [Documentation](https://huggingface.co/docs/transformers/main/en/model_doc/inkling2) | [Blog Post](https://thinkingmachines.ai/news/inkling-2-small/) * Add inkling2 (#50682) by @guarin in [#50682](https://github.com/huggingface/transformers/pull/50682) ### JEV JEV is a decision head that scores single-token labels with a linear layer at the last token of the prompt, soft-capped like the logits of a language model head. `JevForDecision` is the model of the checkpoint and its head, and it reads the head files shipped next to the weights (`head.safetensors` and `judge_config.json` for JEV). The same head is also used by GEV and reads the 255 answer codes of pplx-decider and d3, and it can be run through the experimental `decision` pipeline or directly with `decide`. **Note:** JEV and the decision pipeline are currently experimental. Their APIs, configuration, and behavior may change as development continues. They should be used with caution in production environments. **Links:** [Documentation](https://huggingface.co/docs/transformers/main/en/model_doc/jev) * Add Jev + decision core (#50054) by @ArthurZucker in [#50054](https://github.com/huggingface/transformers/pull/50054) ### LFM3 <img width="732" height="815" alt="image" src="https://github.com/user-attachments/assets/5a67fe26-2cee-4bbf-bc51-65e8f843b756" /> LFM3 is the third generation of Liquid Foundation Models from Liquid AI. Like LFM2, it is a hybrid architecture that combines gated short convolutions with grouped-query attention, with the attention layers split between full-attention and sliding-window layers. The attention layers apply RMSNorm to the query and key heads and gate their output with a per-head sigmoid. Every layer applies a sandwich norm to the operator and feed-forward outputs before the residual addition. **Links:** [Documentation](https://huggingface.co/docs/transformers/main/en/model_doc/lfm3) * [Model] LFM3 Family: LFM3-Text (#50322) by @paulpak58 in [#50322](https://github.com/huggingface/transformers/pull/50322) ### Dots 3 Note Preview Dots 3 Note Preview is a mixture-of-experts causal language model that accepts native text, image, video, and audio inputs. It uses a shared vision encoder for images and videos and a Whisper-style audio encoder, and both encoders project their outputs into the language model's hidden space before autoregressive text generation. BF16 and FP8 inference are supported. **Links:** [Documentation](https://huggingface.co/docs/transformers/main/en/model_doc/dots3_note) * Add dots3-note Preview model support (#47844) by @miraclezqc in [#47844](https://github.com/huggingface/transformers/pull/47844) ### LFM3-VL LFM3-VL is a vision-language model family from Liquid AI, built on the LFM3 language model. It takes images and videos at their native resolution together with text. It combines a hybrid vision encoder (a linear patchifier, gated depthwise 2D convolution layers, and bidirectional grouped-query attention layers with 2D rotary embeddings) with a projector and an LFM3 language model. The projector merges each 2x2 block of patch features into one language token through a layer norm and a two-layer MLP. **Links:** [Documentation](https://huggingface.co/docs/transformers/main/en/model_doc/lfm3_vl) * [Model] LFM3 Family: LFM3-VL (#50392) by @paulpak58 in [#50392](https://github.com/huggingface/transformers/pull/50392) ### IQuestCoder IQuest-Coder-V1 is a family of code language models developed by IQuest Lab, available in 7B, 14B and 40B sizes with base, instruct and thinking variants. Its architecture is the same as Llama, so the Transformers auto classes load it with LlamaModel and LlamaForCausalLM, and only IQuestCoderConfig is specific to IQuestCoder. The looped `IQuest-Coder-V1-*-Loop-*` checkpoints use a different architecture and aren't supported. **Links:** [Documentation](https://huggingface.co/docs/transformers/main/en/model_doc/iquestcoder) * Add IQuestCoder (#50579) by @hmellor in [#50579](https://github.com/huggingface/transformers/pull/50579) ### InternLM3 InternLM3 is an 8B instruction-tuned language model developed by Shanghai AI Laboratory (checkpoint: internlm/internlm3-8b-instruct). Its architecture is the same as Llama, so the auto classes load it with the Llama implementation (LlamaModel and LlamaForCausalLM), and only InternLM3Config is specific to InternLM3. The config names the attention biases `qkv_bias` and the output projection and MLP biases `bias`. InternLM3Config loads these as `attention_bias` and `mlp_bias` and requires them to be equal, as they are in the released checkpoints. **Links:** [Documentation](https://huggingface.co/docs/transformers/main/en/model_doc/internlm3) * Add InternLM3 (#50578) by @hmellor in [#50578](https://github.com/huggingface/transformers/pull/50578) ## Breaking changes * 🚨 Remove the `ep_router` expert-parallel style (#49615) by @IlyasMoutawwakil * 🚨 Run MXFP4 GPT-OSS experts through `ep_dispatch_experts` (#49613) by @IlyasMoutawwakil * 🚨 `deepgemm_megamoe` EP implementation for DeepGEMM Mega MoE (#49606) by @IlyasMoutawwakil * 🚨 Slim down `[audio]` to torchaudio + soundfile + soxr (drop librosa and phonemizer) (#50610) by @eustlb * 🚨 Deprecate Wav2Vec2ProcessorWithLM and pyctcdecode/kenlm LM decoding (#50408) by @eustlb * 🚨 Exporters: `ExportedModel`, Hub save/load, one backend registry (#50029) by @IlyasMoutawwakil * 🚨 Move processing defaults to class (#49089) by @guarin * :rotating_light: [`kernels`] Bump version (#50307) by @vasqu * :rotating_light: Finally drop rope deltas from ModelOutput! (#50153) by @zucchini-nlp * 🚨 Safe-ize pi0 graphs (#50160) by @molbap * 🚨 [serve][breaking] update attn for mac users (#49730) by @SunMarc * 🚨 build and expand once the tp/ep_plan/fsdp_plan (#49527) by @3outeille ## Exporters: export, share and run any model on its backend (#50029, #50032, #50309, #50311) https://github.com/user-attachments/assets/2b17b2ab-b2b8-4e34-a983-4a7177330e4e Every export now returns an `ExportedModel`. You call it like the original model (same kwargs, same output class), push it to the Hub, and load it back on the backend's own runtime. The same API covers Dynamo, ONNX Runtime, OpenVINO and ExecuTorch. ```python from transformers import AutoModel, AutoTokenizer from transformers.exporters import ExportedModel, OnnxConfig, OnnxExporter model = AutoModel.from_pretrained("google/embeddinggemma-2") tokenizer = AutoTokenizer.from_pretrained("google/embeddinggemma-2") inputs = tokenizer(["Exporters are here!"], return_tensors="pt") exported = OnnxExporter().export(model, inputs, OnnxConfig(dynamic=True, ort_fusions="cuda")) exported.push_to_hub("my-org/embeddinggemma-2-onnx") exported_model = ExportedModel.from_pretrained("my-org/embeddinggemma-2-onnx", device="cuda") outputs = exported_model(**inputs) # same output class as model(**inputs) ``` - **Fused for the runtime**: `OnnxConfig(ort_fusions="cpu" | "cuda" | "webgpu" | "dml")` rewrites the graph into ONNX Runtime's fused transformer ops at export time: attention, `GroupQueryAttention` over the KV cache, rotary, norms and `MoE`. OpenVINO exports now hit OpenVINO's fused CPU kernels for attention, RoPE, MoE experts and compressed int8/int4 weights, which makes decode 2.4–3.9× faster than before. - **Faster than `torch.compile`**: on EmbeddingGemma2 (8 × 128 tokens), ONNX Runtime with the TensorRT EP is 7.6× faster than eager PyTorch and 1.4× faster than `torch.compile` on an A100. OpenVINO is 4.1× faster than eager and 2.2× faster than `torch.compile` on a Xeon Platinum 8570 (4.9× and 2.6× with int8 weights). - **Shareable**: an export saves and loads like a model, optionally in a `subfolder` of the model repo. Its `export.json` records the config, input shapes, package versions and I/O names. Quantized exports (PT2E, NNCF, ONNX Runtime) save and run the same way. 🚨 `export()` returns an `ExportedModel`, and an ONNX program is an `onnx_ir.Model`. `OnnxConfig`'s and `OpenVINOConfig`'s `output_path` options are gone in favour of `save_pretrained`. Custom backends register with `register_backend`. 📚 Docs: https://huggingface.co/docs/transformers/main/en/exporters ## Vision This release fixes a range of vision-model bugs: classification pipelines now respect `problem_type`, and several models get corrected behavior (Step3.7 RoPE axis order, MiniMax-M3-VL packed attention isolation, Qwen VL positions with reused caches, PaddleOCR-VL interpolation alignment, Kosmos2 SDPA masking, and Emu3 float image handling). Chunked prefill now keeps image inputs on the * fix(pipelines): respect problem_type in image and video classification pipelines (#50582) by @surendra902 in [#50582] * Fix Step3.7 vision RoPE spatial W/H axis order (#50547) by @caohch-1 in [#50547] * Raise ValueError for out-of-range float images in convert_to_rgb (#50487) by @n24q02m in [#50487] * CI: install OpenVINO and NNCF in the daily GPU image (#50422) by @IlyasMoutawwakil in [#50422] * Fix MiniMax-M3-VL packed vision attention isolation (#50346) by @taking-lying-flat in [#50346] * Fix Qwen VL positions when a text cache is reused with a new image (#50427) by @Arnav66692 in [#50427] * [Docker] Update Nvidia CI and Flash Attn CI images to torch 2.15 / cu132 (#50467) by @ydshieh in [#50467] * Fix PaddleOCR-VL vision position interpolation alignment (#50384) by @scyyh11 in [#50384] * Fix Emu3 image processor crash on float numpy images (#50226) by @simpleqt in [#50226] * Build Idefics-style vision position ids with torch.where (#49917) by @shoumikhin in [#49917] * Keep image inputs on the first chunk of a chunked prefill (#49753) by @digit50 in [#49753] * Docs: note in the v5 migration guide that hidden_states[-1] of vision models is pre-norm (#50303) by @ravediamond in [#50303] * Remove the GitHub API cache-bust from the AMD docker images (#49351) by @tarekziade in [#49351] * [docs] Vision backend differences (#50131) by @stevhliu in [#50131] * [Kosmos2] Fix SDPA applying a causal mask in the image-to-text projection (#50118) by @tarekziade in [#50118] ## Parallelization This release improves distributed training and inference. Expert parallelism gains a selectable `ep_implementation` (all-reduce for CUDA-graph-friendly inference, all-to-all for training). The Trainer now reduces FSDP/HSDP gradients only on the last micro-batch, and the token-count normalization is fixed to use true division. Tensor-parallel fixes cover attention sinks (including Beam attention) and tied-weight comparisons on TPU * Expert-parallel implementations for `ep_dispatch_experts`: all-reduce at inference, all-to-all in training (#49429) by @IlyasMoutawwakil in [#49429] * [FSDP tests] Fork CPU ranks from a forkserver instead of spawning them (#50444) by @ydshieh in [#50444] * [distributed - TPU] Fix tied-weight comparisons on TPUs when using TP (#50406) by @tengomucho in [#50406] * [`distributed`] Trainer: reduce FSDP/HSDP gradients on the last micro-batch only (#50286) by @3outeille in [#50286] * Update FSDP non-rank-0 missing keys test after #45649 (#50260) by @SunMarc in [#50260] * [`Beam`] Fix TP on attn (#50302) by @vasqu in [#50302] * Fix/trainer parallel token count 50212 (#50214) by @BlazeSR10hawk in [#50214] * Reuse the TP/EP test ranks across tests instead of spawning them per test (#49986) by @3outeille in [#49986] * handle local sink in TP (#49567) by @3outeille in [#49567] ## Cache This release fixes several cache correctness issues: static-cache prefill attention in Gemma4's KV-shared layers, Qwen VL positions when a cache is reused with a new image or video, and DeepSeek-V4 compression-state reordering during beam search. It also improves cache sharing for Mistral Large 4 and adds OpenVINO export fusion for the KV cache and attention. Smaller changes cover CI and test fixes, including vLLM CI memory * Gemma4: fix static cache attending to empty cache slots in KV-shared layers at prefill (#50528) by @ydshieh in [#50528] * vLLM CI: fix install and KV-cache memory, add failure report job (#50436) by @ydshieh in [#50436] * Fix DeepSeek-V4 compression cache reordering for beam search (#50348) by @taking-lying-flat in [#50348] * OpenVINO exporter: let OpenVINO fuse attention, RoPE, the KV cache and compressed matmuls (#50311) by @IlyasMoutawwakil in [#50311] * [tests] Pin the chat-template date in Llama's FA static-cache test (#50296) by @tarekziade in [#50296] * Fix a cache test (#50320) by @Cyrilvallez in [#50320] * Improve Mistral Large 4 cache sharing (#50305) by @Cyrilvallez in [#50305] ## Kernels This release fixes several hub kernel issues: the MPS RMSNorm kernel repo id was corrected, the MegaBlocksMoeMLP mapping was restored for MXFP4 GPT-OSS, and a failed flash-attention kernel load is now retried instead of leaving models unregistered. It also raises the minimum `kernels` version (fixing ROCm issues and a multi-GPU bug), bumps mamba-ssm kernels to v4 * Fix the MPS RMSNorm hub kernel repo id (#50714) by @tarekziade in [#50714] * [`GptOss`] Fix the kernels autodispatch test (#50630) by @vasqu in [#50630] * [`kernels`] Bump min version (#50509) by @vasqu in [#50509] * Retry the attention kernel load after a failed `lazy_import_flash_attention` (#50391) by @albertvillanova in [#50391] * Test the dispatched FA3 kernel per device (#50304) by @Abdennacer-Badaoui in [#50304] * upgrade version for mamba-ssm and fla kernel (#50294) by @kaixuanliu in [#50294] * Restore the `MegaBlocksMoeMLP` hub kernel mapping for MXFP4 GPT-OSS (#50150) by @jiqing-feng in [#50150] ## Attention This release fixes a range of attention bugs: vision-attention isolation in MiniMax-M3-VL, SDPA decode under `torch.compile`, eager NaNs in Qwen4-Exp with left padding, an unintended causal mask in Kosmos-2's SDPA projection, and default full-attention mask selection that wrongly picked linear layers. It also retries failed attention kernel loads, excludes padding from the repetition penalty, and lets the O * [`SDPA`] Fix decode under compile (#50388) by @vasqu in [#50388] * Exclude attention-masked padding from repetition penalty (#50149) by @BlazeSR10hawk in [#50149] * Fix Qwen4-Exp eager attention NaNs with left padding (#49923) by @taking-lying-flat in [#49923] * [Masking] Skip linear layers for the default full-attention mask (#50059) by @paulpak58 in [#50059] ## Generation This release fixes several generation bugs: padded generation in RecurrentGemma, batched decoding in Falcon-H1, beam search cache reordering in DeepSeek-V4, and batched metadata and beam scores in `TextGenerationPipeline`. It also lets an unchanged `GenerationConfig` be saved without strict-validation errors, avoids copying the KV cache when decoding with grouped-query attention (GQA), and fixes an `Attribut * Fix RecurrentGemma padded generation by declaring its `layer_types` (#50577) by @ydshieh in [#50577] * Fix Falcon-H1 gated RMSNorm shape during batched decoding (#50507) by @taking-lying-flat in [#50507] * Allow saving an unchanged generation config (#49914) by @benthecarman in [#49914] * Fold GQA query heads onto their KV head when decoding instead of repeating K/V (#49743) by @Yooniel in [#49743] * fix(pipelines): preserve batched generation metadata (#50210) by @BlazeSR10hawk in [#50210] * Fix AttributeError on LinearAttentionLayer in export generate test (#50140) by @ydshieh in [#50140] ## Quantization This release fixes several quantization bugs: FP8 `modules_to_not_convert` entries are now renamed like weight names, so modules such as `f_a_proj` and `f_b_proj` are no longer wrongly quantized. MXFP4 experts now dequantize to the requested dtype instead of always using bfloat16. The `MegaBlocksMoeMLP` hub kernel mapping is restored for MXFP4 GPT-OSS, which fix * fix some error in quantization xpu ci test (#49910) by @sywangyi in [#49910] * Rename FP8 `modules_to_not_convert` entries like weight names (#50354) by @albertvillanova in [#50354] * [docs] Common quantization tasks (#50095) by @stevhliu in [#50095] * Dequantize MXFP4 experts to the requested dtype (#50256) by @qgallouedec in [#50256] * [docs] Quantization (#50093) by @stevhliu in [#50093] ## Audio This release makes audio handling more correct and robust. `AudioClassificationPipeline` now respects the model's problem type (raw outputs for regression, sigmoid for multi-label, softmax otherwise), and VibeVoice and VibeVoice-ASR avoid GPU syncs when removing audio padding and gain a `sample` argument to disable VAE noise for deterministic outputs. Chat templates can also take audio decoded from video via `{"type": "aud * Tests: skip audio model tests when torchaudio or librosa is missing (#50423) by @IlyasMoutawwakil in [#50423] * fix(pipelines): respect audio classification problem type (#50329) by @BlazeSR10hawk in [#50329] * [VibeVoice] Avoid GPU syncs when removing audio padding (#50417) by @hmellor in [#50417] * [VibeVoice] Add `sample` argument to disable VAE noise in audio features (#50179) by @hmellor in [#50179] * Audio from video in jinja (#49382) by @zucchini-nlp in [#49382] ## Bugfixes and improvements * CI pass, CI no pass? (#50690) by @zucchini-nlp in [#50690] * [`Gemma4`] Fix FA slicing (#50681) by @vasqu in [#50681] * Restore the root-level PEFT adapter when resuming from a checkpoint w… (#50368) by @ziywang50 in [#50368] * Granite for Docling (#49012) by @nassarofficial in [#49012] * Move the remaining router-masked MoE plans to `ep_dispatch_experts` (#49607) by @IlyasMoutawwakil in [#49607] * fix(tokenizers): stop treating a missing transformers_version as Mistral (#49733) by @cdcailf in [#49733] * Load the released A.X-K1 checkpoints without unexpected or missing keys (#50644) by @hmellor in [#50644] * Fix get_json_schema truncating multi-line argument descriptions (#50606) by @YusefSyed in [#50606] * Make distributed Trainer tests actually resume from checkpoints (#49723) by @Titus-von-Koeller in [#49723] * Fix Mask2Former _init_weights to match Meta's original initialization (#50596) by @KMaruthi2002 in [#50596] * Fix Inkling router precision in BF16 and autocast (#50621) by @taking-lying-flat in [#50621] * QA: Make `make run-mic` easier to read and to target (#50652) by @tarekziade in [#50652] * Fix `HfArgumentParser` on Python 3.15 (#50651) by @qgallouedec in [#50651] * Avoid mutating input examples in DataCollatorForMultipleChoice (#50611) by @LKL-ZREO in [#50611] * Fix XVector outputs of the wav2vec2 family when the TDNN layers are offloaded (#50646) by @ydshieh in [#50646] * [`Offloading`] Fix tests for some models (#50631) by @vasqu in [#50631] * [`FA`] Fix FA tests for unique models (#50632) by @vasqu in [#50632] * Exporters: run exported models on their backend's runtime (`ModelRunner`) (#50032) by @IlyasMoutawwakil in [#50032] * Exporters: ONNX Runtime fusions at export time (`OnnxConfig(ort_fusions=...)`) (#50309) by @IlyasMoutawwakil in [#50309] * ⚠️ i [`distributed`] Checkpoint the layer's `forward`, not `__call__`, so FSDP2 hooks stay outside the checkpoint (#50490) by @3outeille in [#50490] * Fix Ministral3 and Mistral4 ignoring packed sequences under FlashAttention (#50450) by @EvanZhuang in [#50450] * Support Enum in get_json_schema, raise on custom classes (#50583) by @Rocketknight1 in [#50583] * Raise ValueError for empty conversation with continue_final_message in render_jinja_template (#50604) by @Mengxi-Xu in [#50604] * QA: move to transformers-mlinter 0.1.6 (#50071) by @tarekziade in [#50071] * fixed typo in docs - changed "a encoder-decoder" to "an encoder-decoder" (#50591) by @Peter-Bergman in [#50591] * Revert "Add `transcription` input arg to `apply_transcription_request ` (#49869)" (#50587) by @ebezzam in [#50587] * Bump doc-builder (#50550) by @stevhliu in [#50550] * [docs] Output capturing (#50529) by @stevhliu in [#50529] * Clarify that causal LM labels are shifted internally (#44642) by @joshuaswanson in [#44642] * Avoid device -> host syncs in load_balancing_loss_func (#50463) by @ntenenz in [#50463] * Fix grouped RMSNorm in Mamba2's non-fused path (#49744) by @taking-lying-flat in [#49744] * Fix flaky ONNX export test for wav2vec2-style `ForPreTraining` models (argmax near-tie) (#50575) by @ydshieh in [#50575] * Draft updates for contribution/agent rules (#49783) by @Rocketknight1 in [#49783] * QA / Add a mic runner in Make (#50407) by @tarekziade in [#50407] * [serge] Fix 8 integration tests for model `grounding_dino` failing with `output_mismatch` (tensor values differ (6), oth (#49886) by @sergereview[bot] in [#49886] * Fix flaky `test_causal_lm_loss_honors_shift_labels` (#50533) by @ydshieh in [#50533] * [Fix] Prevent duplicate weight renaming on save_pretrained for ALMs (#50265) by @mrutkows in [#50265] * [docs] Agent-specific content (#50276) by @stevhliu in [#50276] * Tester always passes `per_layer_config` (#50486) by @zucchini-nlp in [#50486] * Drop None-valued keys from messages in `apply_chat_template` (#45422) by @qgallouedec in [#45422] * [Models] Fix torch.compile fullgraph training across models when layerdrop=0.0 (#50475) by @aarushdubey in [#50475] * [masking] Fix packed sequences for abitrary mask forms (#50513) by @Cyrilvallez in [#50513] * Fix flaky `test_eager_matches_batched_and_grouped_inference` in fp16 / bf16 (#50500) by @ydshieh in [#50500] * Skip the query/key head repeat for grouped value heads in gated DeltaNet (#49141) by @manav-simile in [#49141] * Fix flaky backend equivalence tests with Pillow 13 (follow-up of #50105) (#50510) by @ydshieh in [#50510] * fix: forward tool schemas to response parsers (#50385) by @BlazeSR10hawk in [#50385] * Doge: note that the MoE router split is not causal in a full forward pass (#50420) by @Andreas-Hum in [#50420] * Update the longrope inv_freq buffer in place (#50480) by @hmellor in [#50480] * Keep the GLM-5.3-Flash mHC base and scale in float32 (#50413) by @albertvillanova in [#50413] * fix failed cases for beam model (#50235) by @kaixuanliu in [#50235] * [torch 2.15] Update qwen3_vl_moe FA2 integration test expected values (#50481) by @ydshieh in [#50481] * fix(gemma3n): Clamp the AltUp magnitudes instead of using a CPU epsilon tensor (#50457) by @harshaljanjani in [#50457] * [Mistral Large 4] Fix flaky test_left_padding_compatibility (#50479) by @ydshieh in [#50479] * [torch 2.15] Update integration test expected values for A10 (cuda 8.6) (#50478) by @ydshieh in [#50478] * Clarify warmup_steps error message to warmup_steps >= 0 (#50364) by @adi274903 in [#50364] * [Gemma4] Stop prefill at last KV-owning layer when logits_to_keep=1 (#49640) by @pculliton in [#49640] * Fix duplicated docstring (#50446) by @Cyrilvallez in [#50446] * chore(ci): refresh workflow references (#50436) (#50437) by @hf-security-analysis[bot] in [#50437] * [serge] Fix 2 integration tests for model `pegasus` failing with `other` (other (2)) (#49507) by @sergereview[bot] in [#49507] * Harden our Jinja sandboxing (#50431) by @Rocketknight1 in [#50431] * Weight loading: conversion ops declare many-to-many support, and four small loader fixes (#49773) by @IlyasMoutawwakil in [#49773] * [loading] Fix mismatched keys being silently ignored (#50433) by @Cyrilvallez in [#50433] * Capture only the projected hidden states in VLM feature extraction (#49594) by @hmellor in [#49594] * [Mistral Large 4] Fix flaky test_cached_decode_matches_cacheless (#50435) by @ydshieh in [#50435] * [`Colpali`] Fix offload tests (#50432) by @vasqu in [#50432] * Fix! (#50430) by @zucchini-nlp in [#50430] * [vLLM] Add Omni token counting and text replacement offsets for the Transformers backend (#49435) by @harshaljanjani in [#49435] * Subconfig creation in testers (#49528) by @zucchini-nlp in [#49528] * [`distributed`] Support HSDP with expert parallelism (#50293) by @3outeille in [#50293] * [`distributed`] Add HSDP (`dp_replicate_size`) to `DistributedConfig` (#50285) by @3outeille in [#50285] * ZeRO-3: read weights on rank 0 only and convert them one group at a time (#50284) by @3outeille in [#50284] * Multmodal token count validation in processors (#49976) by @zucchini-nlp in [#49976] * Remove deprecated refs (#50374) by @zucchini-nlp in [#50374] * Fix Mistral Large 4 config (#50418) by @Cyrilvallez in [#50418] * Fix flaky `Gemma4Audio2TextModelTest::test_training_gradient_checkpointing_use_reentrant_true` (#50410) by @ydshieh in [#50410] * Fix flaky `T5GemmaModelTest::test_decoder_model_past_with_large_inputs` (#50409) by @ydshieh in [#50409] * Don't pick torchcodec when it can't load or has no FFmpeg (#50362) by @eustlb in [#50362] * [CB] Disable streams on MPS to fix continuous batching with torch 2.15 (#50404) by @Isalia20 in [#50404] * Keep enabling checkpointing on models that only define gradient_checkpointing_enable (#50349) by @qgallouedec in [#50349] * Fix flaky `Owlv2ModelTest::test_eager_matches_sdpa_inference_01_fp16_pad_left` (#50403) by @ydshieh in [#50403] * Fix flaky `PocketTTSAudioTokenizerModelTest::test_batching_equivalence` on CPU (#50402) by @ydshieh in [#50402] * fix(pipelines): validate zero-shot detection batch labels (#50318) by @BlazeSR10hawk in [#50318] * [`distributed`] Divide the expert gradients once when `efsdp_size == 1` (#50292) by @3outeille in [#50292] * [compressed-tensors] better path through conversion mapping (#50238) by @ArthurZucker in [#50238] * Update PR CI to use torch 2.15 (#50361) by @ydshieh in [#50361] * Do not touch torch internal compilation flags in chunked prefill (#50358) by @Cyrilvallez in [#50358] * [`Rope`] Fix per layer rope in head dim manipulation (#49864) by @vasqu in [#49864] * [`FA`] Fix head dim manipulation for more special models (#49862) by @vasqu in [#49862] * Add `transcription` input arg to `apply_transcription_request` (#49869) by @ebezzam in [#49869] * Revert linguistic changes (#50345) by @vasqu in [#50345] * fix: preserve multiple candidates in multimodal pipelines (#50198) by @BlazeSR10hawk in [#50198] * Replace torch.FloatTensor with torch.Tensor outside the model files (#50182) by @qgallouedec in [#50182] * Import torchcodec lazily in processing_utils (#50325) by @eustlb in [#50325] * Replace torch.FloatTensor with torch.Tensor in the model files (#50183) by @qgallouedec in [#50183] * Restore BLT's 512-byte sliding windows (entropy patcher + local encoder/decoder) (#49188) by @hyunW3 in [#49188] * [Video] Require one metadata entry per video and refuse return_metadata=False (#50060) by @paulpak58 in [#50060] * Fix model_input_names singleton issue causing shared state (#42051) by @yashwantbezawada in [#42051] * fix(fetcher): case-sensitive submodule check on case-insensitive filesystems (Windows) (#50326) by @ydshieh in [#50326] * fix(cosmos3_edge): bump backend_equivalence_atol for Pillow 13.x (miss from #50105) (#50327) by @ydshieh in [#50327] * feat(ci): runtime dep recorder — track transformers imports per test file (#50312) by @ydshieh in [#50312] * Keep overrides of the deprecated gradient checkpointing methods working (#50310) by @qgallouedec in [#50310] * perf(pipelines): lazy-load pipeline submodules in pipelines/__init__.py (#50173) by @ydshieh in [#50173] * Fix Doge load balancing loss pairing expert loads with rank-ordered p… (#50266) by @Andreas-Hum in [#50266] * Prevent deepspeed from downcasting rope Buffers (#50275) by @Cyrilvallez in [#50275] * [`FA`] Fix old models that do not use a proper interface (#49859) by @vasqu in [#49859] * Fix EncoderDecoderCache missing .layers in torch export tests (#50263) by @ydshieh in [#50263] * Add SGLang compatibility tests to Transformers CI (#48891) by @adarshxs in [#48891] * [`Moe`] Fix grouped mm fallback (#49857) by @vasqu in [#49857] * Chat template output tensor type (#50103) by @zucchini-nlp in [#50103] * [Distributed] Set `device_id` only for NCCL (#50281) by @michaelbenayoun in [#50281] * [Trainer] Compile with static shapes when the backend is neuron (#49617) by @qgallouedec in [#49617] * [Improvement] Formalize KV sharing (#47290) by @remi-or in [#47290] * Docs: remove duplicate hf_token secret in build_documentation.yml (#50168) by @mishig25 in [#50168] * Fix `bboxes` being overwritten before use in `prepare_example` (#50218) by @Jose-Marcial-GF in [#50218] * fix(tests_fetcher): handle `X as X` re-export syntax and duplicate module entries (#50253) by @ydshieh in [#50253] * Read add_bos_token and add_eos_token from GGUF files (#49649) by @francip in [#49649] * deal with Nan values for aggregating loss (#50172) by @SunMarc in [#50172] * Fix OOM regression for FSDP2 + cpu_ram_efficient_loading on large models (#45649) by @AmineDiro in [#45649] * [serge] Fix 2 integration tests regressed by commit 7d3ae42ee810 (PR #49811) (#50098) by @sergereview[bot] in [#50098] * Fix resize_embeddings tests for deepspeed (#49909) by @kaixuanliu in [#49909] * fix failed test cases for pocket_tts model (#50159) by @kaixuanliu in [#50159] * fix(tests_fetcher): use posix paths throughout, eliminate all os.path.sep/os.path.join patterns (#50219) by @ydshieh in [#50219] * [Gemma4] Pass num_frames_per_video to get_video_features in forward (#50237) by @yzkkai in [#50237] * fix Load DETR-family panoptic masks with load_image_as_tensor (#50234) by @dhekimian in [#50234] * update to torch 2.15 for xpu (#50236) by @sywangyi in [#50236] * Use repo-wide linguist-generated globs so new models don't touch .gitattributes (#50181) by @ArthurZucker in [#50181] * Modular suffix overlap - allow non-model classes (#49754) by @zucchini-nlp in [#49754] * [PaliGemma] Apply final logit softcapping (#50156) by @alejandrorodriguezalvarez884-dot in [#50156] * [CI] Docs bot (#49999) by @stevhliu in [#49999] * Fix ZeRO-3 init for composite models built via _from_config (#49982) by @kaixuanliu in [#49982] * expose private parameter in `trainer.push_to_hub` (#49874) by @not-lain in [#49874] * Trainer: `save_pretrained` on every rank for PEFT model (#49316) by @michaelbenayoun in [#49316] * fix(glm4v): bump backend_equivalence_atol to 0.5 for Pillow 13 compatibility (#50170) by @ydshieh in [#50170] * Allow untokenized output from `apply_transcription_request` (#49944) by @hmellor in [#49944] * need to check model_type and model_name (#50128) by @itazap in [#50128] * Add `TRANSFORMERS_SDPA_FORCE_GQA` envvar in `sdpa_attention_forward` (#49459) by @jakobknauer in [#49459] * Fix `WatermarkDetector` p-value computation (#50123) by @jonasschaefer in [#50123] * test: lazy-load pipeline classes to eliminate collection-phase noise (#50158) by @ydshieh in [#50158] * Remove torch.jit.script (#50082) by @Rocketknight1 in [#50082] * Docs: build English only, other languages are machine-translated (#50120) by @mishig25 in [#50120] * Mark generated files as linguist-generated (#50061) by @ArthurZucker in [#50061] * Standardise processing requires (#50042) by @guarin in [#50042] * v5.23.0-dev0 (#50155) by @ArthurZucker in [#50155] * [LwDetr] Initialize encoder heads like the detection heads (#50041) by @tarekziade in [#50041] * [OneFormer] Fix loss computation when is_training=False (#50039) by @tarekziade in [#50039] * Config annotations (#50067) by @zucchini-nlp in [#50067] * Shard the parameters kept in float32 in their own FSDP2 group (#49501) by @qgallouedec in [#49501] * [Qwen4 Exp] Fix _no_split_modules naming a class that does not exist (#50138) by @eilamc14 in [#50138] * Fix check repo (#49899) by @zucchini-nlp in [#49899] * Update MiniCPM OCR docs and tests (#50134) by @guarin in [#50134] * Add CI dashboard badge when a pull request opens (#50106) by @tarekziade in [#50106] * [docs] correct the MiniCPM-OCR link (#50052) by @airlsyn in [#50052] * Remove expired deprecation cycles (#50037) by @Cyrilvallez in [#50037] * Don't pass code_revision to non-Auto model classes in pipelines (#50126) by @Rocketknight1 in [#50126] * feat(ci): surface pre-existing failures in PR run-slow comment (#50122) by @ydshieh in [#50122] * [Fix] Remove WIP doc for Ml4 (#50124) by @remi-or in [#50124] * [`FA`] Less flaky FA tests (#49861) by @vasqu (direct commit on main) ## Significant community contributions The following contributors have made significant changes to the library over the last release: * @tarekziade * Fix the MPS RMSNorm hub kernel repo id (#50714) * QA: Make `make run-mic` easier to read and to target (#50652) * QA: move to transformers-mlinter 0.1.6 (#50071) * QA / Add a mic runner in Make (#50407) * [tests] Pin the chat-template date in Llama's FA static-cache test (#50296) * Remove the GitHub API cache-bust from the AMD docker images (#49351) * [Kosmos2] Fix SDPA applying a causal mask in the image-to-text projection (#50118) * [LwDetr] Initialize encoder heads like the detection heads (#50041) * [OneFormer] Fix loss computation when is_training=False (#50039) * Add CI dashboard badge when a pull request opens (#50106) * @vasqu * [`Gemma4`] Fix FA slicing (#50681) * [`Offloading`] Fix tests for some models (#50631) * [`FA`] Fix FA tests for unique models (#50632) * [`GptOss`] Fix the kernels autodispatch test (#50630) * [`kernels`] Bump min version (#50509) * [`Colpali`] Fix offload tests (#50432) * [`SDPA`] Fix decode under compile (#50388) * [`Rope`] Fix per layer rope in head dim manipulation (#49864) * [`FA`] Fix head dim manipulation for more special models (#49862) * Revert linguistic changes (#50345) * :rotating_light: [`kernels`] Bump version (#50307) * [`Beam`] Fix TP on attn (#50302) * [`FA`] Less flaky FA tests (#49861) * [`FA`] Fix old models that do not use a proper interface (#49859) * [`Moe`] Fix grouped mm fallback (#49857) * @nassarofficial * Granite for Docling (#49012) * @miraclezqc * Add dots3-note Preview model support (#47844) * @taking-lying-flat * Fix Inkling router precision in BF16 and autocast (#50621) * Fix grouped RMSNorm in Mamba2's non-fused path (#49744) * Fix Falcon-H1 gated RMSNorm shape during batched decoding (#50507) * Fix MiniMax-M3-VL packed vision attention isolation (#50346) * Fix DeepSeek-V4 compression cache reordering for beam search (#50348) * Fix Qwen4-Exp eager attention NaNs with left padding (#49923) * @ydshieh * Fix XVector outputs of the wav2vec2 family when the TDNN layers are offloaded (#50646) * Fix RecurrentGemma padded generation by declaring its `layer_types` (#50577) * Fix flaky ONNX export test for wav2vec2-style `ForPreTraining` models (argmax near-tie) (#50575) * Gemma4: fix static cache attending to empty cache slots in KV-shared layers at prefill (#50528) * Fix flaky `test_causal_lm_loss_honors_shift_labels` (#50533) * Fix flaky `test_eager_matches_batched_and_grouped_inference` in fp16 / bf16 (#50500) * Fix flaky backend equivalence tests with Pillow 13 (follow-up of #50105) (#50510) * [FSDP tests] Fork CPU ranks from a forkserver instead of spawning them (#50444) * [torch 2.15] Update qwen3_vl_moe FA2 integration test expected values (#50481) * [Mistral Large 4] Fix flaky test_left_padding_compatibility (#50479) * [torch 2.15] Update integration test expected values for A10 (cuda 8.6) (#50478) * [Docker] Update Nvidia CI and Flash Attn CI images to torch 2.15 / cu132 (#50467) * vLLM CI: fix install and KV-cache memory, add failure report job (#50436) * [Mistral Large 4] Fix flaky test_cached_decode_matches_cacheless (#50435) * Fix flaky `Gemma4Audio2TextModelTest::test_training_gradient_checkpointing_use_reentrant_true` (#50410) * Fix flaky `T5GemmaModelTest::test_decoder_model_past_with_large_inputs` (#50409) * Fix flaky `Owlv2ModelTest::test_eager_matches_sdpa_inference_01_fp16_pad_left` (#50403) * Fix flaky `PocketTTSAudioTokenizerModelTest::test_batching_equivalence` on CPU (#50402) * Update PR CI to use torch 2.15 (#50361) * fix(fetcher): case-sensitive submodule check on case-insensitive filesystems (Windows) (#50326) * fix(cosmos3_edge): bump backend_equivalence_atol for Pillow 13.x (miss from #50105) (#50327) * feat(ci): runtime dep recorder — track transformers imports per test file (#50312) * perf(pipelines): lazy-load pipeline submodules in pipelines/__init__.py (#50173) * Fix EncoderDecoderCache missing .layers in torch export tests (#50263) * fix(tests_fetcher): handle `X as X` re-export syntax and duplicate module entries (#50253) * fix(tests_fetcher): use posix paths throughout, eliminate all os.path.sep/os.path.join patterns (#50219) * fix(glm4v): bump backend_equivalence_atol to 0.5 for Pillow 13 compatibility (#50170) * test: lazy-load pipeline classes to eliminate collection-phase noise (#50158) * Fix AttributeError on LinearAttentionLayer in export generate test (#50140) * feat(ci): surface pre-existing failures in PR run-slow comment (#50122) * @eustlb * 🚨 Slim down `[audio]` to torchaudio + soundfile + soxr (drop librosa and phonemizer) (#50610) * 🚨 Deprecate Wav2Vec2ProcessorWithLM and pyctcdecode/kenlm LM decoding (#50408) * Don't pick torchcodec when it can't load or has no FFmpeg (#50362) * Import torchcodec lazily in processing_utils (#50325) * @ebezzam * Revert "Add `transcription` input arg to `apply_transcription_request ` (#49869)" (#50587) * Add `transcription` input arg to `apply_transcription_request` (#49869) * @paulpak58 * [Model] LFM3 Family: LFM3-VL (#50392) * [Model] LFM3 Family: LFM3-Text (#50322) * [Video] Require one metadata entry per video and refuse return_metadata=False (#50060) * [Masking] Skip linear layers for the default full-attention mask (#50059) * @ArthurZucker * Add Jev + decision core (#50054) * [compressed-tensors] better path through conversion mapping (#50238) * Use repo-wide linguist-generated globs so new models don't touch .gitattributes (#50181) * Mark generated files as linguist-generated (#50061) * v5.23.0-dev0 (#50155) * @harshaljanjani * fix(gemma3n): Clamp the AltUp magnitudes instead of using a CPU epsilon tensor (#50457) * [vLLM] Add Omni token counting and text replacement offsets for the Transformers backend (#49435) * @remi-or * [Improvement] Formalize KV sharing (#47290) * [Fix] Remove WIP doc for Ml4 (#50124)

  4. v5.22.2 GitHub ↗
    原版更新说明

    # Patch release v5.22.2 Some in between patch for security and distributed fixes. See the included commits :hugs: - [Distributed] Set device_id only for NCCL (#50281) by @michaelbenayoun and @3outeille - Harden our Jinja sandboxing (#50431) by @Rocketknight1 **Full Changelog**: https://github.com/huggingface/transformers/compare/v5.22.1...v5.22.2

  5. v5.22.1 GitHub ↗
    原版更新说明

    # Patch release v5.22.1 We just had to fix the documentation! ** [Fix] Remove WIP doc for Ml4 (https://github.com/huggingface/transformers/pull/50124) from @remi-or

此处仅展示最近 5 个版本。 在原站查看完整版本历史 ↗

当前收录版本

0.0.1

核对来源版本 ↗

安全与评测信息

质量评测

满分100 · 来自 SkillPi LAB 实验室的评测报告。

场景价值78/100

亮点

  • 针对开发者在本地运行、CI 或 PR 日志中遇到类型检查错误时的修复需求,具有明确的实用价值
  • 提供了详细的修复流程和最佳实践,适用于广泛的开发者群体
触发精准92/100

亮点

  • description 明确指出使用场景(ty、make typing 或 make check-repo 检测到类型检查错误时)
  • 触发词精准完整,覆盖多种变体,边界清晰
结构规范95/100

亮点

  • Phase/步骤清晰(8个主要步骤),有出口条件(Verify and close the PR loop)
  • 含端到端示例(代码块展示),frontmatter完整,单文件≤500行
执行可靠90/100

亮点

  • 工具来源明确(ty、make typing、make check-repo),参数正确
  • 覆盖主要异常(Things to never do 部分),不可逆操作有确认机制(Verify and close the PR loop)
证据可验 (前四项均值)89/100

取前四项原始分值的算术平均,四舍五入取整。可通过收录报告核对各项评分与说明,运行记录需单独查证。

正文静态检测

100 / 100 · skillpi-20261123-no-r3-v1

正文未命中当前规则。

分数仅反映正文中的规则命中,供使用前参考。附件与运行行为不在此评分范围内。

权限与使用前检查

根据当前主文档自动整理,命中内容可能是示例或防护说明;不是实际权限声明,也未覆盖附件、外部依赖或运行行为。

未从主文档识别到上述常见操作,不能据此判断无需权限或没有风险。

本站展示提示不会授予权限。涉及文件改动、密钥、外部发送或费用时,仍由你使用的工具按需确认。

安全评级与访问范围

safe · 静态证据核验,不代表运行安全保证。

来源文档未说明。

使用前请由宿主核对并授权实际文件读写、外部服务和联网目的地;本站的核验不会授予任何运行权限。