Downloads · 30 days
22
31% of all-time downloads
zeromodels/t5_small
t5_small is a translation model from zeromodels. Use it when you need text moved from one language to another. It is set up for zeromodels. The card lists the license as apache-2.0.
[](https://github.com/IMvision12/ZeroModels) [](https://imvision12.github.io/ZeroModels/t5/) [](https://huggingface.co/collections/zeromodels/t5-6a8eadfe1bec6ae9ffc24c7f)
Downloads · 30 days
22
31% of all-time downloads
All-time downloads
71
Public
Repo size
242 MB
Likes
0
Public
Click a slice to open those files.
.h5242 MB · 99%
From the Hugging Face model README
Pure-Keras 3 conversion of google-t5/t5-small for zeromodels. One implementation runs unmodified on TensorFlow / Torch / JAX, bit-exact with the Hugging Face original. T5 is a text-to-text encoder-decoder; this repo hosts the full backbone (zm_config.json declares T5Model), and every T5 class (T5ConditionalGenerate, T5EncoderModel, and the classification / QA heads) loads its subset from the one model.weights.h5.
For model details, license, and usage terms, see the upstream model card.
Paper: Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformer
import os
os.environ["KERAS_BACKEND"] = "torch" # or "jax" / "tensorflow"
from zeromodels.models.t5 import T5ConditionalGenerate, T5Tokenizer
model = T5ConditionalGenerate.from_weights("zeromodels/t5_small")
tokenizer = T5Tokenizer.from_weights("zeromodels/t5_small")
inputs = tokenizer("translate English to German: The house is wonderful.")
output_ids = model.generate(
inputs["input_ids"], inputs["attention_mask"], max_new_tokens=40
)
print(tokenizer.decode(output_ids[0]))
Load any T5 variant the same way with from_weights("zeromodels/<variant>"). Browse them all in the T5 collection.
Load any of these from this repo with from_weights("zeromodels/t5_small") (or on the fly via the hf: prefix). The pretrained backbone is shared; task heads not stored in this checkpoint start randomly initialized, ready for fine-tuning (or load a hf: fine-tune).
| Class | Task |
|---|---|
T5Model | Encoder backbone |
T5ConditionalGenerate | Text-to-text generation |
T5EncoderModel | Encoder-only features |
T5SequenceClassify | Sequence classification |
T5TokenClassify | Token classification (NER / POS) |
T5QnA | Extractive question answering |
from zeromodels.models.t5 import T5SequenceClassify
model = T5SequenceClassify.from_weights("zeromodels/t5_small")
Thank you to the Google T5 team for creating and releasing the T5 models.