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

Is there a good method to set the generation_kwargs for tasks so that different kv caches can be used for optimization? #2506

Open
CoderChen01 opened this issue Nov 19, 2024 · 2 comments

Comments

@CoderChen01
Copy link

In this transformers documentation, there are many kv cache methods available. However, I find it inconvenient to set past_key_values in the generation_kwargs of a task, for example, when using SinkCache. My proposed solution is to build a subclass of Task to implement setting past_key_values in the generation_kwargs. Is there a better way?

@baberabb
Copy link
Contributor

Hi! you can pass it on to the command for ex. --gen_kwargs cache_implentation=....,<other kwargs to model.generate>

@CoderChen01
Copy link
Author

Hi! you can pass it on to the command for ex. --gen_kwargs cache_implentation=....,<other kwargs to model.generate>

Thank you for your reply, but something like SinkCache cannot use parameters directly because it needs to be initialized in advance and passed to model.generate through past_key_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

2 participants