Hinglish ↔ English Bidirectional Translator

Buy Me A Coffee

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

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

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 Input English Output
aapka name kya hai? What is your name?
kal mujhe office jaana hai I 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 Input Hinglish 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

Model Direction Base Model Notes
RLM-hinglish-translator Hinglish → English 2B Original release
RLM-hinglish-translator-2 Hinglish → English 4B Chat-format fine-tuning, LoRA rank 64
RLM-hinglish-translator-bidir-2 (this) Hinglish ↔ English 4B Bidirectional support

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

Downloads last month
7
Safetensors
Model size
8B params
Tensor type
BF16
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Dataset used to train rudrashah/RLM-hinglish-translator-bidir-2

Space using rudrashah/RLM-hinglish-translator-bidir-2 1

Collection including rudrashah/RLM-hinglish-translator-bidir-2