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

Batch inference for HF models called with an array of prompts #135

Open
rlouf opened this issue Jun 6, 2023 · 1 comment
Open

Batch inference for HF models called with an array of prompts #135

rlouf opened this issue Jun 6, 2023 · 1 comment
Labels
enhancement transformers Linked to the `transformers` integration

Comments

@rlouf
Copy link
Member

rlouf commented Jun 6, 2023

The generation method in hf_transformers.py is decorated with outlines.vectorize. Thus when we pass, say a 2-dimensional array, we run the model twice when it would be more efficient to flatten the input array and perform batch inference. We thus need to implement a mechanism that allows to flatten the array before passing it to the decorated function.

To do this, we have a choice between implementing a new decorator (preferred) or change the behavior of outlines.vectorize.

@rlouf rlouf added enhancement transformers Linked to the `transformers` integration text labels Jun 6, 2023
@rlouf
Copy link
Member Author

rlouf commented Jun 20, 2023

This is being fixed in #139

@rlouf rlouf removed the text label Dec 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement transformers Linked to the `transformers` integration
Projects
None yet
Development

No branches or pull requests

1 participant