rebase: align vllm-omni with vLLM 2dfaae752b4d
Signed-off-by: tzhouam <tzhouam@connect.ust.hk>
This commit is contained in:
1 parent
4063db33ff
commit
7dcbe4e957
7 files changed
+70
-31
No files matched your search
@@ -150,6 +150,21 @@ class OmniOpenAIServingChat(OpenAIServingChat, AudioMixin):
|
||||
# Harmony flag (always False for vllm-omni models)
|
||||
use_harmony: bool = False
|
||||
|
||||
@property
|
||||
def tool_call_id_type(self) -> str:
|
||||
"""Return the tool call ID type, delegating to model config.
|
||||
|
||||
Upstream vLLM removed the stored ``tool_call_id_type`` attribute
|
||||
from ``OpenAIServingChat`` after the ParserManager refactor; the
|
||||
field is now resolved on demand via ``get_tool_call_id_type``.
|
||||
"""
|
||||
try:
|
||||
from vllm.entrypoints.chat_utils import get_tool_call_id_type
|
||||
|
||||
return get_tool_call_id_type(self.model_config)
|
||||
except Exception:
|
||||
return "random"
|
||||
|
||||
def _should_stream_with_auto_tool_parsing(self, request: ChatCompletionRequest) -> bool:
|
||||
"""Check if streamed tokens should go through the tool-call parser.
|
||||
|
||||
@@ -368,7 +383,7 @@ class OmniOpenAIServingChat(OpenAIServingChat, AudioMixin):
|
||||
tool_dicts = [tool.model_dump() for tool in request.tools]
|
||||
|
||||
if not self.use_harmony:
|
||||
error_check_ret = self.openai_serving_render.validate_chat_template(
|
||||
error_check_ret = self.online_renderer.validate_chat_template(
|
||||
request_chat_template=request.chat_template,
|
||||
chat_template_kwargs=request.chat_template_kwargs,
|
||||
trust_request_chat_template=self.trust_request_chat_template,
|
||||
@@ -396,7 +411,7 @@ class OmniOpenAIServingChat(OpenAIServingChat, AudioMixin):
|
||||
)
|
||||
else:
|
||||
should_include_tools = tool_dicts is not None
|
||||
conversation, engine_prompts = self.openai_serving_render._make_request_with_harmony(
|
||||
conversation, engine_prompts = self.online_renderer._make_request_with_harmony(
|
||||
request, should_include_tools
|
||||
)
|
||||
|
||||
|
||||
Reference in new issue
Block a user