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

Logits warper for batch generation #14530

Closed
bnurbekov opened this issue Nov 25, 2021 · 2 comments
Closed

Logits warper for batch generation #14530

bnurbekov opened this issue Nov 25, 2021 · 2 comments
Assignees

Comments

@bnurbekov
Copy link

bnurbekov commented Nov 25, 2021

🚀 Feature request

Is there a way to modify logits_warper, so that it will apply different parameters (top_p, top_k, temperature) for each item in a batch instead of applying the same parameters for all items in the batch:

next_token_scores = logits_warper(input_ids, next_token_scores)

Motivation

It will very useful for inference because it will increase the throughput. Currently, you cannot really use #7552 for inference because the same parameters apply to the entire batch.

Your contribution

Can help with implementing this feature and reviewing the PR.

@patrickvonplaten
Copy link
Contributor

Hey @bnurbekov,

Sorry for replying so late. We recently allowed to pass customized logits wrapper to generate(). Could you maybe try to build a custom wrapper for your purpose this way?

#14779

@huggingface huggingface deleted a comment from github-actions bot Jan 3, 2022
@github-actions
Copy link

This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.

Please note that issues that do not follow the contributing guidelines are likely to be ignored.

@github-actions github-actions bot closed this as completed Feb 6, 2022
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