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

生成乱码 #2

Open
world2025 opened this issue Nov 6, 2024 · 11 comments
Open

生成乱码 #2

world2025 opened this issue Nov 6, 2024 · 11 comments

Comments

@world2025
Copy link

你好,请问下,我用qwen2.5采用SR方案,生成的内容是乱码,请问知道是什么原因吗?best-of-N没问题。
llm_model qwen2.5-7b-instruct reward_model internlm2-7b-reward
image

@preminstrel
Copy link
Collaborator

这个看上去很奇怪,理论上不至于乱码(因为这些算法只是在众多回答挑一个回答比较好的),你得检查一下 tokenizer 是否correct。你可以 print 一下中间的输出。

@world2025
Copy link
Author

@preminstrel 我理解tokenizer和best-of-N一样,我再检查下吧

@world2025
Copy link
Author

@preminstrel 我用chinese-llama3能正常输出,qwen2.5我debug也没发现tokenizer有什么问题

@preminstrel
Copy link
Collaborator

preminstrel commented Nov 6, 2024

中间的输出正常吗,我的意思是partial generation,我怀疑是model不兼容我们implement的那个LLM(没有用HF),可能需要调一下。

@world2025
Copy link
Author

@也是不正常

@preminstrel
Copy link
Collaborator

qwen2.5的架构和llama在HF里面写法不太一样,这个你得自己改一下我们写的LLM那个class去兼容他,让他正常输出。

@world2025
Copy link
Author

@preminstrel llm这块 和你给出的best-of-N实现有什么不一样吗,我跑best-of-N qwen2.5没问题的

@preminstrel
Copy link
Collaborator

BoN我们是直接用的HF的实现,我们自己算法单独写了个推理的class,为了方便管理kv cache。

@world2025
Copy link
Author

哦哦,好的

@preminstrel
Copy link
Collaborator

@world2025 qwen2 的话你可以参考 https://github.com/bytedance/ShadowKV/blob/main/models/qwen.py

qwen2.5 我不清楚和 qwen2 架构有没有什么区别

@world2025
Copy link
Author

@preminstrel 谢谢

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

2 participants