[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:
co-authored by
Claude Opus 5.5
parent
484c211fe8
commit
d881812500
@@ -11,7 +11,7 @@ from typing import cast
|
||||
from unittest.mock import MagicMock, patch
|
||||
|
||||
import pytest
|
||||
from transformers import PretrainedConfig
|
||||
from transformers import PreTrainedConfig
|
||||
|
||||
from vllm.config.model import ModelConfig
|
||||
from vllm.tokenizers import get_tokenizer
|
||||
@@ -223,7 +223,7 @@ def test_model_config_generation_fallback_forwards_code_revision():
|
||||
patch.object(
|
||||
config_module,
|
||||
"get_config",
|
||||
return_value=PretrainedConfig(),
|
||||
return_value=PreTrainedConfig(),
|
||||
) as get_config,
|
||||
):
|
||||
ModelConfig.try_get_generation_config(model_config)
|
||||
@@ -269,7 +269,7 @@ def test_safetensors_metadata_of_repo_without_safetensors():
|
||||
],
|
||||
)
|
||||
def test_mrope_num_dims(section_key, mrope_section, expected_num_dims):
|
||||
config = PretrainedConfig()
|
||||
config = PreTrainedConfig()
|
||||
config.rope_parameters = {"rope_type": "default", section_key: mrope_section}
|
||||
|
||||
assert uses_mrope(config)
|
||||
@@ -280,7 +280,7 @@ def test_mrope_num_dims(section_key, mrope_section, expected_num_dims):
|
||||
def test_mrope_num_dims_from_config_attribute(section_name):
|
||||
"""Some configs expose the section as an attribute rather than under
|
||||
`rope_parameters`."""
|
||||
config = PretrainedConfig()
|
||||
config = PreTrainedConfig()
|
||||
setattr(config, section_name, [16, 16, 16, 16])
|
||||
|
||||
assert uses_mrope(config)
|
||||
@@ -289,7 +289,7 @@ def test_mrope_num_dims_from_config_attribute(section_name):
|
||||
|
||||
def test_mrope_num_dims_from_nested_rope_parameters():
|
||||
"""Sections nested by layer type must be found, not silently defaulted."""
|
||||
config = PretrainedConfig()
|
||||
config = PreTrainedConfig()
|
||||
config.rope_parameters = {
|
||||
"full_attention": {"mrope_section": [16, 16, 16, 16]},
|
||||
"linear_attention": {"rope_type": "default"},
|
||||
@@ -300,4 +300,4 @@ def test_mrope_num_dims_from_nested_rope_parameters():
|
||||
|
||||
|
||||
def test_mrope_num_dims_without_mrope():
|
||||
assert mrope_num_dims(PretrainedConfig()) == 0
|
||||
assert mrope_num_dims(PreTrainedConfig()) == 0
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
from pathlib import Path
|
||||
|
||||
import pytest
|
||||
from transformers import PretrainedConfig
|
||||
from transformers import PreTrainedConfig
|
||||
|
||||
from vllm.transformers_utils.config import get_config_parser, register_config_parser
|
||||
from vllm.transformers_utils.config_parser_base import ConfigParserBase
|
||||
@@ -19,7 +19,7 @@ class CustomConfigParser(ConfigParserBase):
|
||||
revision: str | None = None,
|
||||
code_revision: str | None = None,
|
||||
**kwargs,
|
||||
) -> tuple[dict, PretrainedConfig]:
|
||||
) -> tuple[dict, PreTrainedConfig]:
|
||||
raise NotImplementedError
|
||||
|
||||
|
||||
|
||||
@@ -5,12 +5,12 @@
|
||||
import json
|
||||
import tempfile
|
||||
|
||||
from transformers import PretrainedConfig
|
||||
from transformers import PreTrainedConfig
|
||||
|
||||
from vllm.transformers_utils.config import _CONFIG_REGISTRY, get_config
|
||||
|
||||
|
||||
class _TestCustomConfig(PretrainedConfig):
|
||||
class _TestCustomConfig(PreTrainedConfig):
|
||||
model_type = "test_custom_model"
|
||||
|
||||
def __init__(self, custom_attr=42, **kw):
|
||||
|
||||
@@ -40,7 +40,7 @@ _SPECULATORS_CONFIG_DICT = {
|
||||
def _patched_get_config_dict(config_dict):
|
||||
"""Return a patch context that bypasses HF Hub for get_config_dict."""
|
||||
return patch(
|
||||
"vllm.transformers_utils.config.PretrainedConfig.get_config_dict",
|
||||
"vllm.transformers_utils.config.PreTrainedConfig.get_config_dict",
|
||||
return_value=(config_dict, {}),
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user