QwenLM / Qwen

The official repo of Qwen (通义千问) chat & pretrained large language model proposed by Alibaba Cloud.
Apache License 2.0
13.59k stars 1.11k forks source link

[BUG] Qwen72B-Chat基于llama.cpp推理,答案末尾总是追加[PAD151645] #992

Closed zhengxingmao closed 8 months ago

zhengxingmao commented 8 months ago

是否已有关于该错误的issue或讨论? | Is there an existing issue / discussion for this?

该问题是否在FAQ中有解答? | Is there an existing answer for this in FAQ?

当前行为 | Current Behavior

输出结果:{"table": {"columns": ["col3", "count"], "data": [["出", 7], ["进", 3]]}}[PAD151645][PAD151643]

期望行为 | Expected Behavior

{"table": {"columns": ["col3", "count"], "data": [["出", 7], ["进", 3]]}}

复现方法 | Steps To Reproduce

基于llama.cpp进行推理问答,答案后总是追加额外字符

运行环境 | Environment

- OS:Ubuntu 22.04
- Python:3.10
- Transformers:4.36
- PyTorch:2.1.2
- CUDA (`python -c 'import torch; print(torch.version.cuda)'`):12.3

备注 | Anything else?

No response

jklj077 commented 8 months ago

llama.cpp对qwen tokenizer的支持有限,[PAD151645][PAD151643]分别对应<|im_end|>和<|endoftext|>,做点后处理吧,匹配删除就可以。或者去llama.cpp提issue。