Skip to content

Commit

Permalink
[fix] add mm_processor_kwargs to extra_body in Chat API.
Browse files Browse the repository at this point in the history
  • Loading branch information
松灵 committed Feb 19, 2025
1 parent fdc5df6 commit 595ef8a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions vllm/entrypoints/openai/protocol.py
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,10 @@ class ChatCompletionRequest(OpenAIBaseModel):
description=("Additional kwargs to pass to the template renderer. "
"Will be accessible by the chat template."),
)
mm_processor_kwargs: Optional[Dict[str, Any]] = Field(
default=None,
description=("Additional kwargs to pass to the HF processor."),
)
guided_json: Optional[Union[str, dict, BaseModel]] = Field(
default=None,
description=("If specified, the output will follow the JSON schema."),
Expand Down
2 changes: 2 additions & 0 deletions vllm/entrypoints/openai/serving_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -451,6 +451,8 @@ async def _preprocess_chat(
prompt_token_ids=prompt_inputs["prompt_token_ids"])
if mm_data is not None:
engine_prompt["multi_modal_data"] = mm_data
if request.mm_processor_kwargs is not None:
engine_prompt["mm_processor_kwargs"] = request.mm_processor_kwargs

return conversation, [request_prompt], [engine_prompt]

Expand Down

0 comments on commit 595ef8a

Please sign in to comment.