Translation
Transformers
Safetensors
Kannada
English
controlmt
text2text-generation
machine-translation
kannada
english
indic
low-resource
code-mix
encoder-decoder
custom_code
Eval Results (legacy)
Instructions to use anandkaman/controlmt-v2.3 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use anandkaman/controlmt-v2.3 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="anandkaman/controlmt-v2.3", trust_remote_code=True)# Load model directly from transformers import AutoModelForSeq2SeqLM model = AutoModelForSeq2SeqLM.from_pretrained("anandkaman/controlmt-v2.3", trust_remote_code=True, dtype="auto") - Notebooks
- Google Colab
- Kaggle
| """ControlMT — Python SDK for the ControlMT v2.3 KN↔EN translator. | |
| Drop-in entry point for users who don't want to wire HuggingFace Transformers | |
| themselves. Picks the right device + dtype + quantization automatically; | |
| overridable when you need control. | |
| Quick start: | |
| from controlmt import ControlMT | |
| model = ControlMT.from_hf() # auto everything | |
| print(model.translate("ನಾನು ಕನ್ನಡ ಮಾತನಾಡುತ್ತೇನೆ.")) # → "I speak Kannada." | |
| Explicit: | |
| model = ControlMT.from_hf(device="cpu", quant="int8") # int8 dynamic on CPU | |
| model = ControlMT.from_hf(device="gpu", dtype="float16") # fp16 on GPU | |
| model = ControlMT.from_hf(device="auto") # GPU-with-CPU-fallback (default) | |
| Batched (user-defined size, defaults to 1 = no batching): | |
| model.batch_translate(texts, batch_size=8) | |
| model.batch_translate(texts, auto_batch=True) # GPU-only auto-fit by VRAM | |
| """ | |
| from controlmt.client import ControlMT | |
| from controlmt._version import __version__ | |
| __all__ = ["ControlMT", "__version__"] | |