Skip to content

vllm.renderers.hy_v4

Classes:

  • HYV4Renderer –

    HF rendering with string content for the default HYV4 VL template.

HYV4Renderer

Bases: HfRenderer

HF rendering with string content for the default HYV4 VL template.

The VL template renders only text parts, but the AST-based content-format detection picks openai for it, which would drop image placeholders.

Source code in vllm/renderers/hy_v4.py
class HYV4Renderer(HfRenderer):
    """HF rendering with string content for the default HYV4 VL template.

    The VL template renders only text parts, but the AST-based content-format
    detection picks `openai` for it, which would drop image placeholders.
    """

    @override
    def _resolve_content_format(
        self, params: "ChatParams"
    ) -> "ChatTemplateContentFormat":
        if params.chat_template is None:
            given_format = params.chat_template_content_format
            return "string" if given_format == "auto" else given_format
        return super()._resolve_content_format(params)