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 bugs to enable key_value cache for generation #36

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

Conversation

Kaffaljidhmah2
Copy link

The prepare_inputs_for_generation() method is used at each decoding step for auto-regressive generation. The default name for the keyword argument of key-value caches is past_key_values instead of past. Renaming past to past_key_values fits the Huggingface Transformer interface and enables the key-value cache for the generation.

Please refer to https://github.com/huggingface/transformers/blob/main/src/transformers/generation/utils.py#L751.

@salesforce-cla
Copy link

salesforce-cla bot commented Aug 4, 2023

Thanks for the contribution! Before we can merge this, we need @Kaffaljidhmah2 to sign the Salesforce Inc. Contributor License Agreement.

@Kaffaljidhmah2
Copy link
Author

I've signed the CLA. Please take a look if is possible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant