[Chore] Use Transformers v5 names and drop redundant processor use_fast (#58550)

Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Harry Mellor
2026-09-24 14:14:10 +00:00
committed by GitHub
co-authored by Claude Opus 5.5
parent 484c211fe8
commit d881812500
218 changed files with 869 additions and 813 deletions
@@ -7,7 +7,7 @@ from unittest import mock
import numpy as np
import pytest
import torch
from transformers import CLIPVisionConfig, LlamaConfig, LlavaConfig, PretrainedConfig
from transformers import CLIPVisionConfig, LlamaConfig, LlavaConfig, PreTrainedConfig
from tests.v1.attention.utils import (
BatchSpec,
@@ -336,7 +336,7 @@ def test_propose_different_layer_counts(num_hidden_layers):
# ---------------------------------------------------------------------------
class _DummyVLMConfig(PretrainedConfig):
class _DummyVLMConfig(PreTrainedConfig):
"""Minimal composite config that mimics VLMs like Kimi-K2.5 or LLaVA.
The text model's parameters (hidden_size, num_attention_heads, …) live
@@ -345,11 +345,11 @@ class _DummyVLMConfig(PretrainedConfig):
model_type = "test_vlm"
def __init__(self, text_config: PretrainedConfig, **kwargs):
def __init__(self, text_config: PreTrainedConfig, **kwargs):
self.text_config = text_config
super().__init__(architectures=["LlamaForCausalLM"], **kwargs)
def get_text_config(self, decoder: bool = False) -> PretrainedConfig:
def get_text_config(self, decoder: bool = False) -> PreTrainedConfig:
del decoder
return self.text_config
@@ -403,7 +403,7 @@ def test_extract_hidden_states_config_preserves_vlm_text_config():
eagle_aux_hidden_state_layer_ids=[1, 2],
)
# The fix: text_config is still a PretrainedConfig, not a dict.
# The fix: text_config is still a PreTrainedConfig, not a dict.
assert isinstance(extract_config.text_config, LlamaConfig)
extracted = get_hf_text_config(extract_config)
@@ -473,7 +473,7 @@ def test_extract_hidden_states_speculative_config_vlm():
def test_extract_hidden_states_config_invalid_text_config():
"""A nested text_config missing required attrs must still be rejected."""
broken_text_config = PretrainedConfig(hidden_size=128)
broken_text_config = PreTrainedConfig(hidden_size=128)
vlm_config = _DummyVLMConfig(text_config=broken_text_config)
extract_config = ExtractHiddenStatesConfig(