Closed Moxoo closed 4 weeks ago
By the way, The py file https://github.com/mlc-ai/mlc-llm/blob/23094e76e33684e19380d77afd1fe521df47a8fb/python/mlc_llm/conversation_template/qwen2.py#L17C42-L17C43
, in line:17,It should probably be stop_str=["<|endoftext|>", "<|im_end|>"],
instead of stop_str=["<|endoftext|>, <|im_end|>"],
@Moxoo Thank you for reporting! For the issue of “missing }
”, are you running with the JSON response_format
? Or you run with the normal text response format (if you didn't manually specify the JSON format then it's the text format). I just want to get more context here on how we can reproduce the issue.
By the way, The py file
https://github.com/mlc-ai/mlc-llm/blob/23094e76e33684e19380d77afd1fe521df47a8fb/python/mlc_llm/conversation_template/qwen2.py#L17C42-L17C43
, in line:17,It should probably bestop_str=["<|endoftext|>", "<|im_end|>"],
instead ofstop_str=["<|endoftext|>, <|im_end|>"],
Thank you so much for catching this!
@Moxoo Thank you for reporting! For the issue of “missing
}
”, are you running with the JSONresponse_format
? Or you run with the normal text response format (if you didn't manually specify the JSON format then it's the text format). I just want to get more context here on how we can reproduce the issue.By the way, The py file
https://github.com/mlc-ai/mlc-llm/blob/23094e76e33684e19380d77afd1fe521df47a8fb/python/mlc_llm/conversation_template/qwen2.py#L17C42-L17C43
, in line:17,It should probably bestop_str=["<|endoftext|>", "<|im_end|>"],
instead ofstop_str=["<|endoftext|>, <|im_end|>"],
Thank you so much for catching this!
Thanks for your reply.
I didn't set response_format
.
I found that this problem did not appear on the native qwen2 model even after quantization. I think it should be that fine-tuning changed the prediction behavior of the model. I will continue to look for the reason. Thank you.
@Moxoo Thanks for getting back. Definitely let us know if you see further issues.
🐛 Bug
To Reproduce
Steps to reproduce the behavior:
1.Do not set), it is a token together with the last part (
<|im_end|>
. Of course, my fine-tuned qwen2 model will output<im_end>
. But the problem is that it is not a separate token (Id 151645 is}
in JSON) of my expected output,In my case it is}<im
2.Then set
<|im_end|>
. The last part of my expected output is stopped along with<im_end>
, so the final output was missing the}
Expected behavior
Environment
conda
, source):sourcepip
, source):sourceAdditional context