Views
No views yet
1#Load the model and tokenizer
2plain_text = "Translate to Turkish: " #English text here!
3inputs = tokenizer(cipher_text, return_tensors="pt", padding=True, truncation=True, max_length=256).to(device)
4outputs = model.generate(inputs["input_ids"], max_length=256)
5translated_text = tokenizer.decode(outputs[0], skip_special_tokens=True)