Instructions to use LatentMT/LatentMT-2.6B-eng-latn-kas-deva with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use LatentMT/LatentMT-2.6B-eng-latn-kas-deva with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("ByteDance/Ouro-2.6B-Thinking") model = PeftModel.from_pretrained(base_model, "LatentMT/LatentMT-2.6B-eng-latn-kas-deva") - Transformers
How to use LatentMT/LatentMT-2.6B-eng-latn-kas-deva with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="LatentMT/LatentMT-2.6B-eng-latn-kas-deva")# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("LatentMT/LatentMT-2.6B-eng-latn-kas-deva", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use LatentMT/LatentMT-2.6B-eng-latn-kas-deva with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "LatentMT/LatentMT-2.6B-eng-latn-kas-deva" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "LatentMT/LatentMT-2.6B-eng-latn-kas-deva", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/LatentMT/LatentMT-2.6B-eng-latn-kas-deva
- SGLang
How to use LatentMT/LatentMT-2.6B-eng-latn-kas-deva with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "LatentMT/LatentMT-2.6B-eng-latn-kas-deva" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "LatentMT/LatentMT-2.6B-eng-latn-kas-deva", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "LatentMT/LatentMT-2.6B-eng-latn-kas-deva" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "LatentMT/LatentMT-2.6B-eng-latn-kas-deva", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use LatentMT/LatentMT-2.6B-eng-latn-kas-deva with Docker Model Runner:
docker model run hf.co/LatentMT/LatentMT-2.6B-eng-latn-kas-deva
LatentMT-2.6B-eng-latn-kas-deva
This repository includes the LoRA adapter checkpoint for eng_Latn-kas_Deva from the paper LatentMT: Machine Translation with Latent Reasoning.
It reflects the paper's trained latent-reasoning setting, where additional recurrent steps are spent inside hidden states rather than exposed as generated chain-of-thought tokens.
The repository makes this efficient translation setup directly reusable through the included adapter weights and metadata.
Checkpoint Information
- Language pair:
eng_Latn-kas_Deva - Recurrent depth:
4
Only adapter release files are included in this repository: adapter_config.json, adapter_model.safetensors or adapter_model.bin, and README.md.
Environment
The relevant dependency requirement specifiers are:
torch==2.7.1
transformers==4.56.2
datasets>=2.14.0
peft>=0.10.0
bitsandbytes>=0.41.0
Loading
from transformers import AutoConfig, AutoModelForCausalLM, AutoTokenizer
from peft import PeftConfig, PeftModel
base_model_id = "ByteDance/Ouro-2.6B-Thinking"
adapter_id = "LatentMT/LatentMT-2.6B-eng-latn-kas-deva"
total_ut_steps = 4
peft_config = PeftConfig.from_pretrained(adapter_id)
base_model_id = peft_config.base_model_name_or_path or base_model_id
config = AutoConfig.from_pretrained(
base_model_id,
trust_remote_code=True,
)
config.total_ut_steps = total_ut_steps
tokenizer = AutoTokenizer.from_pretrained(
base_model_id,
trust_remote_code=True,
)
if tokenizer.pad_token is None:
tokenizer.pad_token = tokenizer.eos_token
base_model = AutoModelForCausalLM.from_pretrained(
base_model_id,
config=config,
device_map="auto",
torch_dtype="auto",
trust_remote_code=True,
)
model = PeftModel.from_pretrained(base_model, adapter_id)
model.eval()
model.config.use_cache = True
if getattr(model, "generation_config", None) is not None:
model.generation_config.use_cache = True
Intended Use
This is for machine translation research.
Licenses
This repo is made open-source under the Apache License 2.0.
This adapter was trained for ByteDance/Ouro-2.6B-Thinking.
The base model was published by under Apache 2.0 (https://huggingface.co/ByteDance/Ouro-2.6B-Thinking).
- Downloads last month
- 7
Model tree for LatentMT/LatentMT-2.6B-eng-latn-kas-deva
Base model
ByteDance/Ouro-2.6B-Thinking