This pr is proposed to add T5 Encoder Model and T5Model. They are tested both in graph mode and pynative mode. Google/T5-small and DeepFloyd/T5-v1.1_xxl have been supported.
The T5Model could be utilized conveniently by the following command:
from mindone.transformers.models import T5Model, T5EncoderModel
model = T5Model.from_pretrained("Google/T5-small")
encoder_model = T5EncoderModel.from_pretrained("DeepFloyd/t5-v1_1-xxl")
Additionally, the feature of loading more than one safe tensors file has beed added.
Fixes # (issue)
Adds # (feature)
Before submitting
[ ] This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
[ ] Did you make sure to update the documentation with your changes? E.g. record bug fixes or new features in What's New. Here are the
documentation guidelines
[x] Did you build and run the code without any errors?
[ ] Did you report the running environment (NPU type/MS version) and performance in the doc? (better record it for data loading, model inference, or training tasks)
[ ] Did you write any new necessary tests?
Who can review?
Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.
What does this PR do?
This pr is proposed to add T5 Encoder Model and T5Model. They are tested both in graph mode and pynative mode. Google/T5-small and DeepFloyd/T5-v1.1_xxl have been supported.
The T5Model could be utilized conveniently by the following command:
from mindone.transformers.models import T5Model, T5EncoderModel model = T5Model.from_pretrained("Google/T5-small") encoder_model = T5EncoderModel.from_pretrained("DeepFloyd/t5-v1_1-xxl")
Additionally, the feature of loading more than one safe tensors file has beed added.
Fixes # (issue)
Adds # (feature)
Before submitting
What's New
. Here are the documentation guidelinesWho can review?
Anyone in the community is free to review the PR once the tests have passed. Feel free to tag members/contributors who may be interested in your PR.
@xxx