CoolFace
Modelpublic

rudrashah/RLM-hinglish-translator-bidir-2

sourceHugging Facemitupdated 5mo agoView on Hugging Face
1likes46downloads
Model Card

Hinglish ↔ English Bidirectional Translator

<p align="center"> <a href="https://www.buymeacoffee.com/rudrashah" target="_blank"> <img src="https://cdn.buymeacoffee.com/buttons/v2/default-yellow.png" alt="Buy Me A Coffee" style="height: 60px !important;width: 217px !important;"> </a> </p>

RLM-hinglish-translator-bidir-2 is a fully bidirectional Hinglish ↔ English translation model — the first in this series to support translation in both directions. Built on the same 4B instruction-tuned base as v2 and fine-tuned using PEFT (LoRA) with TRL's SFTTrainer, it lets you seamlessly convert between informal Hinglish and English without needing two separate models.

GGUF VERSION


What's New

  • —Bidirectional translation — Translate from Hinglish → English and English → Hinglish in a single model.
  • —Direction-aware prompting — The model uses explicit instruction prompts to distinguish translation direction at inference time.
  • —Same strong base — Retains the 4B instruction-tuned backbone from v2 for high fluency and contextual understanding.
  • —Expanded training — Fine-tuned on both directions of the findnitai/english-to-hinglish dataset for balanced performance.

Usage

Hinglish → English

python
from transformers import AutoTokenizer, AutoModelForCausalLM

model_id = "rudrashah/RLM-hinglish-translator-bidir-2"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(model_id)

messages = [
    {
        "role": "user",
        "content": "Hinglish:\naapka name kya hai?"
    }
]

inputs = tokenizer.apply_chat_template(
    messages,
    add_generation_prompt=True,
    tokenize=True,
    return_dict=True,
    return_tensors="pt",
).to("cuda")

outputs = model.generate(
    **inputs,
    max_new_tokens=128,
    use_cache=True,
    temperature=1.0,
    top_p=0.95,
    top_k=64,
)
print(tokenizer.batch_decode(outputs))

English → Hinglish

python
messages = [
    {
        "role": "user",
        "content": "English:\nWhat are you doing tomorrow?"
    }
]

inputs = tokenizer.apply_chat_template(
    messages,
    add_generation_prompt=True,
    tokenize=True,
    return_dict=True,
    return_tensors="pt",
).to("cuda")

outputs = model.generate(
    **inputs,
    max_new_tokens=128,
    use_cache=True,
    temperature=1.0,
    top_p=0.95,
    top_k=64,
)
print(tokenizer.batch_decode(outputs))
Note: Always include the Language of Input for Best Result.

Examples

Hinglish → English

Hinglish InputEnglish Output
aapka name kya hai?What is your name?
kal mujhe office jaana haiI have to go to the office tomorrow.
Tumne kal ki match dekhi thi? kon man of the match bana tha?Did you watch yesterday's match? Who was man of the match?

English → Hinglish

English InputHinglish Output
What is your name?aapka naam kya hai?
I have to go to the office tomorrow.kal mujhe office jaana hai.
Did you watch yesterday's match?Tumne kal ki match dekhi thi?

Limitations

  • —Best suited for short to medium-length informal sentences, similar to everyday chat messages.
  • —May struggle with heavy regional slang, very long sentences, or dialect-specific expressions.
  • —English → Hinglish outputs reflect the Hinglish style present in the training data and may not match all regional variations.

Model History

ModelDirectionBase ModelNotes
RLM-hinglish-translatorHinglish → English2BOriginal release
RLM-hinglish-translator-2Hinglish → English4BChat-format fine-tuning, LoRA rank 64
RLM-hinglish-translator-bidir-2 (this)Hinglish ↔ English4BBidirectional support

Thanks to that one girl who motivated me. Thank you P.