Downloads · 30 days
14
7% of all-time downloads
jeff-vincent/flan-t5-spanish-tutor
flan-t5-spanish-tutor is a machine learning model from jeff-vincent. Use it for the machine learning task on the model card, and read the license before you ship it in a product. The card lists the license as mit.
Downloads · 30 days
14
7% of all-time downloads
All-time downloads
207
Public
Parameters
783M
15.7 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors3.1 GB · 100%
From the Hugging Face model README
** Work in progress **
This is a Flan T5 large model (780M+ params) fine tuned on synthectic Spanish conversation data I've generated.
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
import torch
model_path = "jeff-vincent/flan-t5-spanish-tutor"
# Load the tokenizer and model
tokenizer = AutoTokenizer.from_pretrained(model_path)
model = AutoModelForSeq2SeqLM.from_pretrained(model_path)
# Set device (GPU or CPU)
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
model.to(device)
# Tokenize input and move it to the same device as the model
input_text = "Me gusta mango, pero prefiero manzanas. Y tu, que tipas de frutas te gustan?"
input_ids = tokenizer.encode(input_text, return_tensors="pt").to(device)
# Generate output
output_ids = model.generate(
input_ids,
max_length=520,
min_length=500,
do_sample=True
)
output_text = tokenizer.decode(output_ids[0], skip_special_tokens=True)
print(output_text)