This repository was archived by the owner on Sep 10, 2025. It is now read-only.
Add text transform to T5 bundler #1856
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Expose
T5TransforminT5Bundle, which allows for text pre-processing of input strings before feeding them into a T5 model.Process
Create a callable attribute in
T5Bundlethat will be used to pre-process the input text to a T5 model and also decode the model's output back into text. The transform objects for the encoder-only and encoder-decoder base models are instantiated usingT5Transform, which calls on a pre-trained SentencePiece model.Testing
Integration tests were updated to accept input strings, which are then passed to the transform method. The resulting token ids are fed into the model, and the output tensors are checked against results from the reference HuggingFace models.
pytest test/prototype/integration_tests/test_models.pyFollow-Up
decodemethod. Wrapper class for end-to-end t5 model #1880