Skip to content

Qwen3.5-35B crashes with transformers chat #45362

Closed

Description

@Sector14

System Info

Using "transformers chat" with Qwen3.5-35B the moment a prompt is sent the server errors with an AttributeError

[snip]
File "/mnt/venvs/rocm6.4/lib64/python3.12/site-packages/transformers/cli/serving/chat_completion.py", line 174, in _streaming
    queue, streamer = gen_manager.generate_streaming(model, processor, inputs, gen_config, request_id=request_id)
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/mnt/venvs/rocm6.4/lib64/python3.12/site-packages/transformers/cli/serving/utils.py", line 565, in generate_streaming
    streamer = DirectStreamer(processor._tokenizer, loop, queue, skip_special_tokens=True)
                              ^^^^^^^^^^^^^^^^^^^^
AttributeError: 'Qwen3VLProcessor' object has no attribute '_tokenizer'. Did you mean: 'tokenizer'?

I'm running transformers 5.5.0 from pip along with the rocm6.4 version of pytorch (2.8.0+rocm6.4.4.gitc1404424). If you want a full pip version list let me know.

I've tried a couple of other random text models with transformers chat without issue, just Qwen so far that appears to be an issue.

Qwen's readme mentions transformers chat as a possible way to use it, so I'm assuming this used to work? Although they were using 4.57 dev version at the time the readme was written.

Who can help?

No response

Information

  • The official example scripts
  • My own modified scripts

Tasks

  • An officially supported task in the examples folder (such as GLUE/SQuAD, ...)
  • My own task or dataset (give details below)

Reproduction

transformers serve

transformers chat Qwen/Qwen3.5-35B-A3B

Once loaded, type any text at the prompt, press enter and server will error.

Expected behavior

Model response streamed back.

Activity

  1. sharziki commented on Apr 11, 2026

    @sharziki
    Contributor

    Hi! I can take this. The root cause is that generate_streaming() and generate_cb_streaming() in serving/utils.py access processor._tokenizer to get the Rust tokenizer backend, but this only works for PreTrainedTokenizerFast — ProcessorMixin subclasses like Qwen3VLProcessor expose the tokenizer at .tokenizer (public attribute) instead.

    The fix is to resolve the fast tokenizer from the processor first, then access ._tokenizer:

    rust_tok = getattr(processor, 'tokenizer', processor)._tokenizer

    This handles both code paths (ProcessorMixin and PreTrainedTokenizerFast). Two locations to update: lines 565 and 664.

    Happy to submit a PR. AI assistance (Claude Code) will be used — I'll review and validate every change.

  2. added a commit that references this issue on Apr 11, 2026
    ace0000
  3. added a commit that references this issue on Apr 13, 2026
    a1b89d7
  4. added a commit that references this issue on Apr 18, 2026
    ed5951b
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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions