[CI] Ignore ruff D209, rejoin the docstrings it split, and silence incompatible-rule warnings (#57212)
Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com> Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5
parent
1085b64425
commit
651a88c09a
@@ -26,8 +26,7 @@ def fast_tokenizer():
|
||||
def _make_base_renderer_with(tokenizer):
|
||||
"""Build a minimal BaseRenderer subclass that exposes the tokenizer so we
|
||||
can call ``_tokenize_prompt`` directly. BaseRenderer is abstract because of
|
||||
``render_messages``; we just need a stub.
|
||||
"""
|
||||
``render_messages``; we just need a stub."""
|
||||
from vllm.renderers.base import BaseRenderer
|
||||
|
||||
class _StubRenderer(BaseRenderer):
|
||||
@@ -92,8 +91,7 @@ class TestTokenizePromptOffsets:
|
||||
def test_base_renderer_without_override_yields_no_offsets(self, fast_tokenizer):
|
||||
"""A renderer that does not override ``_can_produce_offsets`` never
|
||||
emits offsets, even with a fast tokenizer and the flag set. This locks
|
||||
in the base-default-False / subclass-override design.
|
||||
"""
|
||||
in the base-default-False / subclass-override design."""
|
||||
from vllm.renderers.base import BaseRenderer
|
||||
|
||||
class _BareRenderer(BaseRenderer):
|
||||
@@ -127,8 +125,7 @@ class TestTokenizePromptOffsets:
|
||||
|
||||
def test_slow_tokenizer_with_flag_no_offsets(self, fast_tokenizer):
|
||||
"""Force is_fast=False to simulate a Slow tokenizer: the flag is set
|
||||
but offsets must not be returned because it cannot produce them.
|
||||
"""
|
||||
but offsets must not be returned because it cannot produce them."""
|
||||
from unittest.mock import PropertyMock, patch
|
||||
|
||||
renderer = _make_base_renderer_with(fast_tokenizer)
|
||||
@@ -147,8 +144,7 @@ class TestTokenizePromptOffsets:
|
||||
@pytest.mark.parametrize("mm_key", ["multi_modal_data", "multi_modal_uuids"])
|
||||
def test_multimodal_with_flag_no_offsets(self, fast_tokenizer, mm_key):
|
||||
"""Offsets index the text prompt, which is meaningless once multimodal
|
||||
data is interleaved, so they are suppressed when MM inputs are present.
|
||||
"""
|
||||
data is interleaved, so they are suppressed when MM inputs are present."""
|
||||
renderer = _make_base_renderer_with(fast_tokenizer)
|
||||
params = TokenizeParams(max_total_tokens=None, return_token_offsets=True)
|
||||
prompt = {"prompt": "Hello.", mm_key: {"image": ["x"]}}
|
||||
@@ -160,8 +156,7 @@ class TestTokenizePromptOffsets:
|
||||
@pytest.mark.asyncio
|
||||
async def test_tokenize_prompt_async_returns_offsets(self, fast_tokenizer):
|
||||
"""The async path offloads the sync tokenizer; it must yield the same
|
||||
offsets as the sync path.
|
||||
"""
|
||||
offsets as the sync path."""
|
||||
renderer = _make_base_renderer_with(fast_tokenizer)
|
||||
params = TokenizeParams(max_total_tokens=None, return_token_offsets=True)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user