OptimalScale / OptimalScale/LMFlow

[BUG]unexpected behavior on qwen 2.5 series templates

Open
#934 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
8.5k
Forks
822
PR merge metrics
No merged PRs in 30d

Description

Describe the bug
When using qwen 2.5 series templates, tokenizer.apply_chat_template throw Jinja error

To Reproduce
Steps to reproduce the behavior:

  1. Create a conversation dataset without a system prompt
  2. use qwen 2.5 series template
  3. The error occurs.

Additional context
https://github.com/OptimalScale/LMFlow/blob/main/src/lmflow/tokenization/hf_decoder_model.py#L160
Here the code does not handle None system prompt properly.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in src/lmflow/tokenization/hf_decoder_model.py around line 160 and reproduce the failure with a conversation dataset that has no system prompt and a Qwen 2.5 template. Check the tokenizer.apply_chat_template path and confirm the reproduction completes without the reported Jinja error.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
machine-learning
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.