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

GCG推理时无法批处理 #52

Open
zhicong01 opened this issue Sep 24, 2024 · 0 comments
Open

GCG推理时无法批处理 #52

zhicong01 opened this issue Sep 24, 2024 · 0 comments

Comments

@zhicong01
Copy link

作者您好,我发现在我移植的gcg推理代码中无法实现批处理,具体如下:
predict, seg_hidden_states = forward_model(
batch_inputs, pixel_values,
self.omg_tokenizer, self.omg_model, self.omg_llm,
self.omg_projector_text2vision,
self.omg_gen_config, self.omg_stop_criteria)
对于batch为4的图像输入,pixel_values包含四个元素,如下:
image
但是predict, seg_hidden_statesg尺寸不对,是对应单图的尺寸,如下:
image
image

怀疑是调用代码的这一句有问题,当pixel_values为单个或多个元素的list时,mm['inputs_embeds']都为(1,68,4096)的向量
mm_inputs = prepare_inputs_labels_for_multimodal(llm=llm, input_ids=ids, pixel_values=pixel_values)

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