Skip to content

Commit 941d54a

Browse files
authored
[bugfix]Return the Transformer version from 4.57.2 to 4.57.1 (#4423)
### What this PR does / why we need it? This PR pins the transformers dependency to 4.57.1. Reason: CI tests (specifically test_completion_with_prompt_embeds.py) are failing with an AttributeError: 'dict' object has no attribute 'model_type' when using newer versions of transformers. The issue stems from a bug in tokenization_utils_base.py where the code attempts to access the model_type field of a configuration dictionary (_config) using dot notation (_config.model_type) instead of dictionary key lookup (_config["model_type"] or _config.get("model_type")). This occurs in the logic block checking for transformers_version <= 4.57.2. Pinning the version to 4.57.1 bypasses this buggy code path and restores CI stability. Error Traceback: ``` shell /usr/local/python3.11.13/lib/python3.11/site-packages/transformers/tokenization_utils_base.py:2419: if _is_local and _config.model_type not in [ E AttributeError: 'dict' object has no attribute 'model_type' ``` - vLLM main: vllm-project/vllm@2918c1b Signed-off-by: MrZ20 <2609716663@qq.com>
1 parent 31a2c09 commit 941d54a

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ requires = [
1414
"pandas-stubs",
1515
"setuptools>=64",
1616
"setuptools-scm>=8",
17+
"transformers<=4.57.1",
1718
"torch-npu==2.7.1",
1819
"torch==2.7.1",
1920
"torchvision",

requirements.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,5 @@ numba
2828
#--pre
2929
#--extra-index-url https://mirrors.huaweicloud.com/ascend/repos/pypi
3030
torch-npu==2.7.1
31+
32+
transformers<=4.57.1

0 commit comments

Comments
 (0)