Skip to content

chat template issue qwen3.8-27B #66

Description

@amitpandey-io

using latest gmlx
gguf is 'qwen3.8-27B-bf16-mtp.gguf' ( has mtp weights along with it)

2026-08-22 19:27:45 WARNING:  /v1/chat/completions: ignoring unsupported parameter(s): max_completion_tokens, store (see the parameter support table in docs/server-config.md)
Traceback (most recent call last):
  File "/Users/user/.local/share/uv/tools/gmlx/lib/python3.13/site-packages/mlx_vlm/server/openai.py", line 1564, in chat_completions_endpoint
    formatted_prompt = apply_chat_template(
        processor,
    ...<6 lines>...
        **gen_args.to_template_kwargs(),
    )
  File "/Users/user/.local/share/uv/tools/gmlx/lib/python3.13/site-packages/gmlx/server_patches/chat_behavior.py", line 335, in apply_chat_template
    out = fn(*a, **kw)
  File "/Users/user/.local/share/uv/tools/gmlx/lib/python3.13/site-packages/gmlx/server_patches/apc.py", line 102, in apply_chat_template
    out = orig_render(processor, config, prompt, *a, **kw)
  File "/Users/user/.local/share/uv/tools/gmlx/lib/python3.13/site-packages/gmlx/server_patches/render.py", line 123, in apply_chat_template
    return prompt_utils.get_chat_template(
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
        processor, msgs, add_generation_prompt, **kwargs)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/user/.local/share/uv/tools/gmlx/lib/python3.13/site-packages/mlx_vlm/prompt_utils.py", line 780, in get_chat_template
    return template_processor.apply_chat_template(
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
        messages,
        ^^^^^^^^^
    ...<2 lines>...
        **template_kwargs,
        ^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/Users/user/.local/share/uv/tools/gmlx/lib/python3.13/site-packages/transformers/processing_utils.py", line 2138, in apply_chat_template
    prompt, generation_indices = render_jinja_template(
                                 ~~~~~~~~~~~~~~~~~~~~~^
        conversations=conversations,
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    ...<6 lines>...
        **template_kwargs,
        ^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/Users/user/.local/share/uv/tools/gmlx/lib/python3.13/site-packages/transformers/utils/chat_template_utils.py", line 581, in render_jinja_template
    rendered_chat = compiled_template.render(
        messages=chat,
    ...<3 lines>...
        **kwargs,
    )
  File "/Users/user/.local/share/uv/tools/gmlx/lib/python3.13/site-packages/jinja2/environment.py", line 1295, in render
    self.environment.handle_exception()
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/Users/user/.local/share/uv/tools/gmlx/lib/python3.13/site-packages/jinja2/environment.py", line 942, in handle_exception
    raise rewrite_traceback_stack(source=source)
  File "<template>", line 160, in top-level template code
  File "/Users/user/.local/share/uv/tools/gmlx/lib/python3.13/site-packages/jinja2/sandbox.py", line 401, in call
    return __context.call(__obj, *args, **kwargs)
           ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/user/.local/share/uv/tools/gmlx/lib/python3.13/site-packages/transformers/utils/chat_template_utils.py", line 479, in raise_exception
    raise jinja2.exceptions.TemplateError(message)
jinja2.exceptions.TemplateError: Unexpected message role.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions