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

new_h_i = torch.cat((before, vision_proj[i], after), dim=0)[:seqlen] #3

Open
pengqianhan opened this issue Oct 6, 2024 · 1 comment

Comments

@pengqianhan
Copy link

minimind-v/model
/model.py 中的第394行 ‘new_h_i = torch.cat((before, vision_proj[i], after), dim=0)[:seqlen]’ 这里的vision_proj是图片的embedding,那before 和 after 分别代表什么呢?按 README 中的描述 after 是 prompt 的文字描述的embedding,那 before 又什么呢?希望大佬有空的时候可以解答一下,非常感谢。

@jingyaogong
Copy link
Owner

jingyaogong commented Oct 6, 2024

举的例子里<图像占位字符>是位于开头的,before可以省略:

<图像占位字符>\n文字提示词

事实上prompt一般是:

文字提示词1 文字提示词2 文字提示词3\n<图像占位字符>\n文字提示词4

也就是 before字符 + <图像占位字符> + after字符 共同构成了整个prompt


No Thanks,有任何问题欢迎随时继续交流~

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