Change8

Migrating to Transformers v4.53.1

Version v4.53.1 introduces 4 breaking changes. This guide details how to update your code.

Released: 7/4/2025

4
Breaking Changes
5
Migration Steps
9
Affected Symbols

⚠️ Check Your Code

If you use any of these symbols, you need to read this guide:

tp pluginQwen2-VLSmolVLMGemma3nmultimodal processoroptimizerflexsdpaeager

Breaking Changes

Issue #1

The fix for unprotected import of the 'tp' plugin might affect custom setups relying on specific import behaviors that are now protected.

Solution

If you were manually importing components from the 'tp' plugin in a way that is now blocked, you should review the plugin's public API and use officially exposed methods or classes instead.

Issue #2

Key mapping for VLMs (Vision-Language Models) has been adjusted, which could break custom serialization or deserialization logic that relied on the previous key structure.

Solution

Review any code that manually handles key mapping or serialization/deserialization for VLM components and update it to match the new standard defined in the fix.

Issue #3

Fixes related to Gemma3n might alter internal behavior or output stability, potentially causing regressions if your application depended on the previous buggy behavior.

Solution

Thoroughly re-test any workflows involving Gemma3n models, especially around initialization, inference, and output validation.

Issue #4

Fixes to multimodal processor initialization might change how keyword arguments (kwargs) are handled during setup, potentially causing unexpected argument duplication if you were passing kwargs previously.

Solution

If you pass kwargs during the initialization of multimodal processors, verify that the processor now handles these arguments correctly without duplication. Adjust your initialization calls if necessary.

Migration Steps

  1. 1
    1. Update your dependency to the latest version containing these fixes.
  2. 2
    2. If you use Vision-Language Models (VLMs), check any custom code related to key mapping and update it according to the new internal structure.
  3. 3
    3. If you utilize Gemma3n models, run comprehensive integration tests to ensure output stability and performance remain acceptable.
  4. 4
    4. Review initialization calls for multimodal processors where you pass keyword arguments (kwargs) to ensure no argument duplication occurs.
  5. 5
    5. If you were relying on specific import paths within the 'tp' plugin, refactor those imports to use officially supported public APIs.

Release Summary

This patch release focuses on bug fixes for Vision Language Models (VLMs) like Qwen2-VL and SmolVLM, alongside introducing packed tensor format support for various attention backends.

Need More Details?

View the full release notes and all changes for Transformers v4.53.1.

View Full Changelog