Skip to content

Add transformers v5.10 support - #1863

Open
echarlaix wants to merge 10 commits into
mainfrom
transformers-v5.10-support
Open

Add transformers v5.10 support#1863
echarlaix wants to merge 10 commits into
mainfrom
transformers-v5.10-support

Conversation

@echarlaix

@echarlaix echarlaix commented Jul 13, 2026

Copy link
Copy Markdown
Collaborator

Add support for transformers v5.10:

  • CLIPTextTransformer was removed in Refactor CLIP-like models聽transformers#44431, so text_encoder.text_model no longer exists since transformers v5.6
  • gemma4_text_attention_forward: transformers v5.6 (First model聽transformers#45788) replaced past_key_values.shared_layers / self.kv_shared_layer_index with a shared_kv_states dict passed through kwargs
  • rot_pos_emb() in _OVQwen2VLForCausalLM and _OVQwen3OmniMoeForCausalLM now calls self._rotary_pos_emb(pos_ids) directly when is_transformers_version(">=", "5.9"), since the upstream signature changed from taking max_grid_size to taking pos_ids directly

@HuggingFaceDocBuilderDev

Copy link
Copy Markdown

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

@echarlaix
echarlaix marked this pull request as draft July 13, 2026 16:43
@echarlaix
echarlaix marked this pull request as draft July 13, 2026 16:43
Comment thread .github/workflows/test_openvino_slow.yml Outdated
Comment thread .github/workflows/test_openvino.yml Outdated
@echarlaix
echarlaix force-pushed the transformers-v5.10-support branch from ac9a688 to 052e1a9 Compare July 16, 2026 16:36
@echarlaix echarlaix added openvino-slow Runs OpenVINO slow tests with different versions of transformers and removed openvino-slow Runs OpenVINO slow tests with different versions of transformers labels Jul 17, 2026
@echarlaix
echarlaix marked this pull request as ready for review July 17, 2026 12:49
@echarlaix
echarlaix marked this pull request as ready for review July 17, 2026 12:49
@echarlaix
echarlaix marked this pull request as draft July 17, 2026 16:06
max_grid_size = grid_thw[:, 1:].max()
rotary_pos_emb_full = self._rotary_pos_emb(max_grid_size)
rotary_pos_emb = rotary_pos_emb_full[pos_ids].flatten(1)
if is_transformers_version(">=", "5.9"):

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@echarlaix
echarlaix marked this pull request as ready for review July 20, 2026 14:55
@echarlaix
echarlaix marked this pull request as ready for review July 20, 2026 14:55

@regisss regisss left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants