Deprecate Transformers v4 support (#45161)

Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
This commit is contained in:
Harry Mellor
2026-06-11 11:04:01 +08:00
committed by GitHub
parent b038a2f73b
commit 18d87a87dc
19 changed files with 61 additions and 267 deletions
+2 -6
View File
@@ -14,12 +14,10 @@ from dataclasses import is_dataclass
from datetime import datetime
from enum import IntEnum
from functools import lru_cache
from importlib.metadata import version
from pathlib import Path
from typing import TYPE_CHECKING, Any, Literal, TypeVar, get_args
import torch
from packaging.version import Version
from pydantic import ConfigDict, Field, model_validator
import vllm.envs as envs
@@ -697,10 +695,8 @@ class VllmConfig:
# Therefore, the presence of tie_word_embeddings in SomeVLTextConfig cannot
# be used as a signal for whether tie_word_embeddings should be copied from
# hf_config to the language_model config.
if (
Version(version("transformers")) >= Version("5.0.0")
and model_config.is_multimodal_model
and hasattr(model_config.hf_config, "tie_word_embeddings")
if model_config.is_multimodal_model and hasattr(
model_config.hf_config, "tie_word_embeddings"
):
tie_word_embeddings = model_config.hf_config.tie_word_embeddings
hf_config.get_text_config().tie_word_embeddings = tie_word_embeddings