[Misc] Break chat_utils into more maintainable modules. (#60972)

Signed-off-by: wang.yuqi <yuqi.wang@daocloud.io>
This commit is contained in:
wang.yuqi
2026-10-13 15:08:07 +00:00
committed by GitHub
parent f395a6b1ad
commit 669f85e686
21 changed files with 2533 additions and 2375 deletions
@@ -9,7 +9,6 @@ from openai.types.chat import (
ChatCompletionContentPartImageParam,
ChatCompletionContentPartTextParam,
)
from openai.types.chat.chat_completion_content_part_image_param import ImageURL
from vllm import PoolingParams
from vllm.exceptions import VLLMValidationError
@@ -21,6 +20,7 @@ from vllm.renderers.chat_utils import (
ChatCompletionContentPartParam,
ChatCompletionMessageParam,
CustomChatCompletionMessageParam,
ImageURL,
)
from vllm.renderers.hf import resolve_chat_template
from vllm.utils.collection_utils import chunk_list
@@ -7,9 +7,9 @@ from typing import Any, TypeAlias, cast
import torch.nn.functional as F
from vllm import PoolingParams, PoolingRequestOutput, TokensPrompt
from vllm.exceptions import ChatTemplateResolutionError
from vllm.logger import init_logger
from vllm.renderers import TokenizeParams
from vllm.renderers.chat_utils import ChatTemplateResolutionError
from vllm.renderers.hf import safe_apply_chat_template
from vllm.renderers.inputs.preprocess import (
extract_target_prompt,
+2 -2
View File
@@ -15,7 +15,7 @@ from vllm.renderers.chat_utils import (
ChatCompletionContentPartTextParam,
ConversationMessage,
MultiModalItemTracker,
_parse_chat_message_content_parts,
parse_chat_message_content_parts,
)
from .typing import (
@@ -193,7 +193,7 @@ def _parse_score_content(
mm_parser = mm_tracker.create_parser()
parse_res = _parse_chat_message_content_parts(
parse_res = parse_chat_message_content_parts(
role=role,
parts=parts,
mm_tracker=mm_tracker,