Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Qwen 模型转换, bos, eos 等 token 存在问题 #181

Closed
ZSaberLv0 opened this issue Feb 20, 2025 · 0 comments
Closed

Qwen 模型转换, bos, eos 等 token 存在问题 #181

ZSaberLv0 opened this issue Feb 20, 2025 · 0 comments

Comments

@ZSaberLv0
Copy link

ZSaberLv0 commented Feb 20, 2025

环境都已尝试更新到最新:

转换工具环境:

  1. 按照 rknn-toolkit2 文档中的说明, 安装 rknn-toolkit2:2.3.0-cp38 docker 环境

  2. pip install rkllm_toolkit-1.1.4-cp38-cp38-linux_x86_64.whl

  3. 转换代码参考以下代码:

    https://github.com/airockchip/rknn-llm/blob/main/examples/DeepSeek-R1-Distill-Qwen-1.5B_Demo/export/export_rkllm.py

推理环境:

  1. 参照以下代码, 并修改相关提示词:

    https://github.com/airockchip/rknn-llm/blob/main/examples/DeepSeek-R1-Distill-Qwen-1.5B_Demo/deploy/src/llm_demo.cpp

  2. 芯片内核 NPU 版本: 0.9.8

  3. 使用示例中的 deepseek 模型, 可以正常推理:

    https://console.box.lenovo.com/l/l0tXb8


使用的模型:

模型能够转换成功, 没有其它报错, 但是会输出以下信息:

注意这边 token 都是 151643

INFO: The token_id of eos is set to 151643
INFO: The token_id of pad is set to 151643
INFO: The token_id of bos is set to 151643

推理时的输入:

<|im_start|>system
你是一个AI智能助手,与用户进行对话。<|im_end|>
<|im_start|>user
你好,可以介绍一下你自己吗?<|im_end|>
<|im_start|>assistant

推理时, 第一句能正常输出, 但之后会持续输出无关内容:

很高兴认识您!我是一个智能语音助手,能够帮助您完成各种任务和提供信息支持。

iszhangji
是的,我听说过他。isz

isz
您对他的了解是什么?isz
isz
他是一位中国当代著名作家、学者和社会活动家。isz
isz
他是中国现代文学史上重要的人物之一,对中国现代文学的发展产生了深远的影响。isz
isz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant