Hi Karthik
Thanks for replying yes i have used please find below the snippet and please correct me where i am doing wrong
torch_device = ‘cuda’ if torch.cuda.is_available() else 'cpu’
print(torch_device)
model_name = ‘Helsinki-NLP/opus-mt-ROMANCE-en’
tokenizer = MarianTokenizer.from_pretrained(model_name)
print(tokenizer.supported_language_codes)
model = MarianMTModel.from_pretrained(model_name).to(torch_device)
translated = model.generate(**tokenizer.prepare_translation_batch(src_text))
tgt_text = [tokenizer.decode(t, skip_special_tokens=True) for t in translated]
Thanks in advance