Hi thanks for the quick answer, I’ll post then the code:
import torch
from transformers import AutoModelForSeq2SeqLM, AutoTokenizer

from timeit import default_timer as timer

src_text = ['Senior Level Software Engineer', 'Instrumental Software Technologies', 'Saratoga Springs, NY']

torch_device = 'cuda' if torch.cuda.is_available() else 'cpu'

print(torch_device)

mname_fwd = 'Helsinki-NLP/opus-mt-en-es'

fwd = AutoModelForSeq2SeqLM.from_pretrained(mname_fwd).to(torch_device)
fwd_tok = AutoTokenizer.from_pretrained(mname_fwd)

if torch_device == 'cuda':
    fwd = fwd.half()

star = timer()

fwd_batch = fwd_tok(src_text, return_tensors='pt', padding=True, truncation=True).to(torch_device)
translated = fwd.generate(**fwd_batch)
translated_txt = fwd_tok.batch_decode(translated, skip_special_tokens=True)

end = timer()

print(translated_txt)

print(end-star)


cuda
[‘Ingeniero de software de nivel superior’, ‘Tecnologías de software instrumentales’, ‘Saratoga Springs, NY’]
0.5867295530042611