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

fix generation input preparation #1512

Merged
merged 3 commits into from
Nov 3, 2023
Merged

fix generation input preparation #1512

merged 3 commits into from
Nov 3, 2023

Conversation

echarlaix
Copy link
Collaborator

No description provided.

@echarlaix echarlaix marked this pull request as ready for review November 2, 2023 17:46
@echarlaix echarlaix added the gpu-test trigger GPU tests label Nov 2, 2023
Comment on lines +632 to +640
if past_key_values is not None:
past_length = past_key_values[0][0].shape[2]
# Some generation methods already pass only the last input ID
if input_ids.shape[1] > past_length:
remove_prefix_length = past_length
else:
# Default to old behavior: keep only final ID
remove_prefix_length = input_ids.shape[1] - 1
input_ids = input_ids[:, remove_prefix_length:]
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@echarlaix echarlaix removed the gpu-test trigger GPU tests label Nov 2, 2023
Copy link
Contributor

@fxmarty fxmarty left a comment

Choose a reason for hiding this comment

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

LGTM - some tests are failing by my fault (still issues with patching staticmethod)!

@echarlaix
Copy link
Collaborator Author

echarlaix commented Nov 2, 2023

LGTM - some tests are failing by my fault (still issues with patching staticmethod)!

Yes, we can fix this tomorrow (happy to take a look)

edit: fix done by removing _make_causal_mask unpatch as done (and later removed) in 967b8c9, not a great solution but better than a broken CLI wdyt @fxmarty?

@echarlaix echarlaix added gpu-test trigger GPU tests and removed gpu-test trigger GPU tests labels Nov 3, 2023
@fxmarty fxmarty merged commit 554e312 into main Nov 3, 2023
54 of 68 checks passed
@fxmarty fxmarty deleted the fix-pkv branch November 3, 2023 17:42
echarlaix added a commit that referenced this pull request Nov 3, 2023
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.

2 participants