-
Notifications
You must be signed in to change notification settings - Fork 4
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 batch processing possible during inference? #7
Comments
Sorry, I am a little confused about your requirements. Does this code have an issue and does not solve the batch prediction? |
Ah, sorry for the confusion. I was wondering how I can use the pre-trained model with batch sizes bigger than 1. As an example, let's say I have these two texts as input:
And I'd like to make MTL-data-to-text model describe both t1 and t2 at the same time instead of running the forward pass twice as shown below:
Does the current codebase support inferencing with bs>1? |
inputs = tokenizer([t1, t2], return_tensors="pt")
generated_ids = model.generate(**inputs)
tokenizer.batch_decode(generated_ids, skip_special_tokens=True) Does this satisfy your requirements? |
Yes, it works. Oddly enough, I tried this before I created the issue, but it didn't work then. Anyway, thank you. I'm closing the issue. |
Hi, thank you for providing a pre-trained model. I am wondering if it is possible to perform a batched prediction with the model at https://huggingface.co/RUCAIBox/mtl-data-to-text ? Something like below?:
The text was updated successfully, but these errors were encountered: