Files
vLLM/tests/transformers_utils/test_deepseek_v4_utils.py
Harry MellorClaude Opus 5.5mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>Kevin H. Luu
b965ee564d [Chore] Use upstream Transformers DeepseekV4Config (#61392)
Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Co-authored-by: Kevin H. Luu <khluu000@gmail.com>
2026-10-15 01:08:08 -07:00

20 lines
728 B
Python

# SPDX-License-Identifier: Apache-2.0
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
from transformers import DeepseekV4Config
from vllm.transformers_utils.deepseek_v4_utils import get_compress_ratios
# Legacy field as shipped by deepseek-ai/DeepSeek-V4-Flash-Vision-Exp
COMPRESS_RATIOS = [0, 0] + [4, 128] * 20 + [4, 0, 0, 0]
def test_compress_ratios_survive_upstream_config():
"""Upstream pops `compress_ratios`; the helper must recover it."""
config = DeepseekV4Config(
num_hidden_layers=43,
num_nextn_predict_layers=3,
compress_ratios=COMPRESS_RATIOS,
)
assert not hasattr(config, "compress_ratios")
assert get_compress_ratios(config) == COMPRESS_RATIOS