Skip to content
This repository was archived by the owner on Sep 10, 2025. It is now read-only.

Conversation

@pmabbo13
Copy link
Contributor

@pmabbo13 pmabbo13 commented Jul 22, 2022

Description

Expose T5Transform in T5Bundle, which allows for text pre-processing of input strings before feeding them into a T5 model.

Process

Create a callable attribute in T5Bundle that 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 using T5Transform, 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.py

Follow-Up

Copy link
Contributor

@Nayef211 Nayef211 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@parmeet parmeet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@pmabbo13 pmabbo13 merged commit 4a5f11c into pytorch:main Jul 25, 2022
@pmabbo13 pmabbo13 deleted the feature/integrate-t5-transform branch July 25, 2022 16:16
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants