Skip to content

qwen3 tool rendering #74

@csmith23

Description

@csmith23

I've been using tinker to finetune qwen3 30b a3b instruct on conversations involving tool use, and just wanted to bring up a discrepancy in the qwen3 renderer in the cookbook vs. the jinja templates on huggingface.

In the jinja template, there are the lines

{%- elif message.role == "tool" %}
        {%- if loop.first or (messages[loop.index0 - 1].role != "tool") %}
            {{- '<|im_start|>user' }}
        {%- endif %}

which render tool responses with the user role, while in the cookbook the role is used as-is,

ob_str = f"{maybe_newline}<|im_start|>{message['role']}\n"

in renderers.py, lines 332 and 445.

The rendering of elements under the "tools" key of a conversation as part of the system prompt is also not implemented, but that seems to be the case for all renderers, not just the qwen ones

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions