Instructions to use ViuAI/ViuTranslate with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use ViuAI/ViuTranslate with Transformers:
# Use a pipeline as a high-level helper # Warning: Pipeline type "translation" is no longer supported in transformers v5. # You must load the model directly (see below) or downgrade to v4.x with: # 'pip install "transformers<5.0.0' from transformers import pipeline pipe = pipeline("translation", model="ViuAI/ViuTranslate")# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("ViuAI/ViuTranslate", device_map="auto") - Notebooks
- Google Colab
- Kaggle
๐ ViuTranslate-500M
High-Performance English โ Hindi Neural Machine Translation Foundation Model
๐ ViuAI Studio | ๐ Translation Dataset | ๐ Architecture | โก Quickstart | ๐ 5090 Runner
๐ Introduction
ViuTranslate-500M is a production-grade bilingual Neural Machine Translation (NMT) foundation model developed by ViuAI. Built on the custom Sarus-500M decoder-only transformer architecture, it is engineered specifically for fluid, high-fidelity bidirectional translation between English and Hindi (Devanagari).
Unlike general-purpose conversational LLMs that frequently inject conversational fluff, unsolicited commentary, or mathematical reasoning hallucinations, ViuTranslate-500M is optimized purely for deterministic, end-to-end translation with native-speaker fluency.
๐ Key Capabilities & Highlights
- โก Google-Translate Style Direct Input:
- Accepts raw, untagged sentences directly. Input plain English to receive pure Hindi; input plain Hindi to receive pure English.
- ๐ฌ Command / Instruction Mode Support:
- Seamlessly handles explicit prompts (e.g.,
Translate to Hindi: ...andTranslate to English: ...).
- Seamlessly handles explicit prompts (e.g.,
- ๐ก๏ธ Zero Synthetic Data Guarantee:
- Trained exclusively on authentic, human-verified parallel corpora from top research institutions (CFILT IIT Bombay and AI4Bharat Samanantar). Zero synthetic, template-generated, or LLM-distilled text.
- ๐ค 100% Devanagari Unicode Coverage:
- Custom 64,003-vocab byte-fallback BPE tokenizer ensures exactly 0
<unk>tokens across standard benchmark corpora.
- Custom 64,003-vocab byte-fallback BPE tokenizer ensures exactly 0
- ๐ Ultra-Low Latency & Edge-Ready:
- Sub-15ms generation per sentence on modern GPUs (RTX 5090, RTX 4090, A100, T4) with efficient Grouped Query Attention (GQA).
๐ Model Specifications
| Parameter | Specification | Details |
|---|---|---|
| Model Name | ViuTranslate-500M | ViuAI Translation Engine |
| Base Architecture | Sarus-500M | Decoder-only Autoregressive Transformer |
| Total Parameters | 500,642,560 (~500M) | Optimal size for high translation density & fast inference |
| Hidden Dimension ($d_{\text{model}}$) | 1280 | Latent semantic space |
| Transformer Layers | 24 | Balanced depth for deep bilingual representations |
| Attention Heads | 20 Query / 4 KV Heads | Grouped Query Attention (GQA 5:1 ratio) |
| Intermediate Size (FFN) | 3456 | SwiGLU non-linear projection |
| Vocabulary Size | 64,003 | Byte-fallback BPE with full Devanagari coverage |
| Context Length | 2048 Tokens | Rotary Positional Embeddings (RoPE, $\theta = 10,000$) |
| Normalization | RMSNorm | Root Mean Square Layer Normalization ($\epsilon = 10^{-6}$) |
| Precision | BFloat16 / FP16 | Native Blackwell, Ada Lovelace, Ampere support |
๐ Training Corpus & Provenance
The model is trained on the curated dataset hosted at ViuAI/ViuTranslate-Data:
| Dataset Source | Contributing Institution | Curated Pairs | Description |
|---|---|---|---|
| IIT Bombay English-Hindi Corpus | CFILT, IIT Bombay | 50,000 | Gold-standard academic corpus covering news, judicial, and literature |
| AI4Bharat Samanantar | IIT Madras / AI4Bharat | 50,000 | Large-scale verified Indian language web & publication texts |
| IIT Bombay Benchmark Test Set | CFILT, IIT Bombay | 2,502 | Standardized international evaluation test suite |
| Total Curated Dataset | โ | 102,502 Pairs | 13.6 Million Active Training Tokens |
๐ก๏ธ Mathematical Quality Guardrails:
- Length Ratio Bound: Enforced $0.40 \le \frac{\text{len(en)}}{\text{len(hi)}} \le 2.40$ to eliminate truncated pairs.
- Script Purity: Minimum 50% Latin characters on English side; minimum 40% Devanagari characters ($[\u0900-\u097F]$) on Hindi side.
- Hygiene Sanitization: 100% stripped of HTML tags, XML entities, programming code blocks, and URLs.
- Bidirectional Augmentation: Trained in both Direct Mode and Command Mode in both directions ($EN \leftrightarrow HI$).
๐ Quickstart & Inference
1. Installation
pip install torch tokenizers huggingface_hub
2. Standalone Python Inference
import torch
from tokenizers import Tokenizer
from huggingface_hub import hf_hub_download
# Download model code and tokenizer
repo_id = "ViuAI/ViuTranslate"
tok_path = hf_hub_download(repo_id=repo_id, filename="tokenizer.json")
config_path = hf_hub_download(repo_id=repo_id, filename="config.py")
model_path = hf_hub_download(repo_id=repo_id, filename="model.py")
# Import architecture
import sys, os
sys.path.insert(0, os.path.dirname(config_path))
from config import ViuAIConfig
from model import ViuAI
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
tokenizer = Tokenizer.from_file(tok_path)
cfg = ViuAIConfig(vocab_size=64003, context_length=2048)
model = ViuAI(cfg).to(device)
# Load weights (supports base checkpoint or fine-tuned weights)
try:
ckpt_path = hf_hub_download(repo_id=repo_id, filename="viutranslate_final.pt")
except Exception:
ckpt_path = hf_hub_download(repo_id="ViuAI/ViuAI-500M", filename="checkpoints/ckpt_latest.pt")
state = torch.load(ckpt_path, map_location=device, weights_only=False)
model.load_state_dict(state.get("model_state_dict", state), strict=False)
model.eval()
def translate(text: str) -> str:
prompt = f"<|user|>\n{text.strip()}<|endofturn|>\n<|assistant|>\n"
inp = torch.tensor([tokenizer.encode(prompt).ids], device=device)
with torch.no_grad():
out = model.generate(inp, max_new_tokens=128, temperature=0.2, top_p=0.9, eos_token_id=64002)
return tokenizer.decode(out[0][inp.shape[1]:].tolist()).replace("<|endofturn|>", "").strip()
# Examples
print("EN -> HI:", translate("Consistency and discipline are the keys to long term success."))
print("HI -> EN:", translate("เคธเฅเคฐเค เคชเฅเคฐเฅเคต เคฎเฅเค เคเคเคคเคพ เคนเฅ เคเคฐ เคชเคถเฅเคเคฟเคฎ เคฎเฅเค เคกเฅเคฌเคคเคพ เคนเฅเฅค"))
๐๏ธ Training on RTX 5090 (32GB)
Run the ultra-optimized 1-click training launcher directly from your terminal:
# Download and launch runner
curl -O https://huggingface.co/ViuAI/ViuTranslate/raw/main/runners/run_5090.py
python run_5090.py
- Target Hardware: NVIDIA GeForce RTX 5090 (32GB VRAM, Blackwell Architecture)
- Configuration:
micro_batch=32,grad_accum=2(Effective Batch = 64),bfloat16 - Speed:
100,000 tokens/sec (6.5 minutes for full 100K training run)
๐ Repository Structure
ViuAI/ViuTranslate
โโโ README.md # Official Model Card & Documentation
โโโ config.py # Sarus-500M Architecture Config
โโโ model.py # PyTorch Transformer Definition
โโโ tokenizer.json # 64,003 Byte-Fallback Tokenizer
โโโ tokenizer_config.json # Fast Tokenizer Configuration
โโโ special_tokens_map.json # Turn & Separation Tokens
โโโ generation_config.json # Recommended Decoding Parameters
โ
โโโ scripts/ # Modular Pipeline Scripts
โ โโโ train.py # High-Throughput SFT Training Engine
โ โโโ inference.py # Interactive CLI Translation Console
โ โโโ evaluate.py # BLEU / chrF++ Benchmark Evaluator
โ
โโโ runners/ # 1-Click Hardware Launchers
โโโ run_5090.py # RTX 5090 Ultra-Fast Launcher
โโโ run_kaggle.py # Kaggle GPU T4 Launcher
๐ Citation & Reference
@misc{viutranslate2026,
author = {ViuAI Research Team},
title = {ViuTranslate-500M: High-Performance English-Hindi Neural Machine Translation Foundation Model},
year = {2026},
publisher = {Hugging Face},
journal = {Hugging Face Model Hub},
howpublished = {\url{https://huggingface.co/ViuAI/ViuTranslate}}
}