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

Use image_seq_len to determine proper cache size in generate_v2 #1674

Merged
merged 2 commits into from
Sep 25, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions recipes/dev/generate_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,7 @@ def generate(self, cfg: DictConfig):
batch_size=1,
dtype=self._dtype,
encoder_max_seq_len=(
model_inputs["encoder_mask"][0].size(1)
if is_multimodal_input
else None
self.model_transform.image_seq_len if is_multimodal_input else None
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rn this is only supported for FlamingoTransform, right? Should probably assert or something

),
decoder_max_seq_len=total_response_length,
)
Expand Down
Loading