Views
No views yet
1from transformers import AutoModelForSeq2SeqLM, AutoTokenizer
2
3model_name = "rairashmi/hinglish_translation_lora"
4model = AutoModelForSeq2SeqLM.from_pretrained(model_name)
5tokenizer = AutoTokenizer.from_pretrained(model_name)
6
7def translate_english_to_hinglish(text):
8 inputs = tokenizer(f"translate English to Hinglish: {text}", return_tensors="pt", padding=True, truncation=True)
9 outputs = model.generate(**inputs)
10 return tokenizer.decode(outputs[0], skip_special_tokens=True)
11
12sentence = "How are you?"
13translation = translate_english_to_hinglish(sentence)
14print(f"🔹 English: {sentence}")
15print(f"🟢 Hinglish: {translation}")sacrebleu)1@misc{hinglish_translation,
2 author = {Your Name},
3 title = {English to Hinglish Translation Model},
4 year = {2025},
5 url = {https://huggingface.co/rairashmi/hinglish_translation_lora}
6}