Downloads · 30 days
173
4% of all-time downloads
dumitrescustefan/t5-v1_1-base-romanian
t5-v1_1-base-romanian is a machine learning model from dumitrescustefan. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for transformers. The card lists the license as apache-2.0.
This is a pretrained-from-scratch T5v1.1 base model (247M parameters) on the t5x platform.
Downloads · 30 days
173
4% of all-time downloads
All-time downloads
4.3K
Public
Repo size
3.6 GB
Likes
0
Public
Click a slice to open those files.
.bin1.2 GB · 50%
From the Hugging Face model README
This is a pretrained-from-scratch T5v1.1 base model (247M parameters) on the t5x platform.
Training was performed on a clean 80GB Romanian text corpus for 4M steps with these scripts. The model was trained with an encoder sequence length of 512 and a decoder sequence length of 256.
!! IMPORTANT !! This model was pretrained on the span corruption MLM task, meaning this model is not usable in any downstream task without finetuning first!
from transformers import T5Tokenizer, T5Model
tokenizer = T5Tokenizer.from_pretrained('dumitrescustefan/t5-v1_1-base-romanian')
model = T5Model.from_pretrained('dumitrescustefan/t5-v1_1-base-romanian')
input_ids = tokenizer("Acesta este un test", return_tensors="pt").input_ids # Batch size 1
decoder_input_ids = tokenizer("Acesta este", return_tensors="pt").input_ids # Batch size 1
# preprocess: Prepend decoder_input_ids with start token which is pad token for T5Model.
# This is not needed for torch's T5ForConditionalGeneration as it does this internally using labels arg.
decoder_input_ids = model._shift_right(decoder_input_ids)
# forward pass
outputs = model(input_ids=input_ids, decoder_input_ids=decoder_input_ids)
last_hidden_states = outputs.last_hidden_state
print(last_hidden_states.shape) # this will print [1, 3, 768]
Remember to always sanitize your text! Replace ş and ţ cedilla-letters to comma-letters with :
text = text.replace("ţ", "ț").replace("ş", "ș").replace("Ţ", "Ț").replace("Ş", "Ș")
because the model was not trained on cedilla ş and ţs. If you don't, you will have decreased performance due to <UNK>s and increased number of tokens per word.
We'd like to thank TPU Research Cloud for providing the TPUv4 cores we used to train these models!
Yours truly,