Skip to content

llm 支持输入参数为input_embeds #3509

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

makeknowledge
Copy link

本次以新增接口的方式修改的。
image

hf transformer的Qwen2的forward函数 参数中既支持input_ids形式,同时也支持inputs_embeds 形式。 这样其实通用性更高。 比如我的这个场景: 我自定义模型 VIT + LLM, VIT部分的输出给LLM作为输入时,已经是inputs_embeds的结果了而不是input_ids, 但是咱们的MNN的LLM的forward接口是没有这个参数的
hf transformer这两个参数使用方式和逻辑都是很清晰的,我想参考hf代码,优化下咱们MNN的forward接口

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

Successfully merging this pull request may close these issues.

1 participant