Translation
Transformers
PyTorch
English
Hindi
viuai
viutranslate
sarus-500m
nmt
english-to-hindi
hindi-to-english
indic
devanagari
bfloat16
zero-synthetic
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
| from dataclasses import dataclass | |
| class ViuAIConfig: | |
| vocab_size: int = 64003 | |
| d_model: int = 1280 | |
| n_layers: int = 24 | |
| n_heads: int = 20 | |
| n_kv_heads: int = 4 | |
| ffn_hidden: int = 3456 | |
| context_length: int = 2048 | |
| rope_theta: float = 10000.0 | |
| norm_eps: float = 1e-5 | |
| z_loss_weight: float = 0.0 # 0.0 default for SFT/Inference (use 1e-4 for pretraining) | |
| use_checkpoint: bool = True | |
| attn_dropout: float = 0.05 # 0.0 for pretraining, 0.05 for SFT | |
| resid_dropout: float = 0.05 # 0.0 for pretraining, 0.05 for SFT | |
| neftune_alpha: float = 5.0 # NEFTune noise scale for SFT quality boost | |
| def pretrain(cls, **kwargs): | |
| """Standard configuration for base pretraining (no dropout, 1e-4 z-loss).""" | |
| defaults = dict(z_loss_weight=1e-4, attn_dropout=0.0, resid_dropout=0.0, neftune_alpha=0.0) | |
| defaults.update(kwargs) | |
| return cls(**defaults) | |
| def sft(cls, **kwargs): | |
| """Optimized configuration for Supervised Fine-Tuning.""" | |
| defaults = dict(z_loss_weight=0.0, attn_dropout=0.05, resid_dropout=0.05, neftune_alpha=5.0) | |
| defaults.update(kwargs) | |
| return cls(**defaults) | |
| # Compatibility Alias | |
| ModelArgs = ViuAIConfig | |