Text Generation
Transformers
Safetensors
English
German
machine-translation
error-detection
error-correction
lora
qwen3
Instructions to use otelk/mt-error-detect-correct with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use otelk/mt-error-detect-correct with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="otelk/mt-error-detect-correct")# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("otelk/mt-error-detect-correct", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use otelk/mt-error-detect-correct with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "otelk/mt-error-detect-correct" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "otelk/mt-error-detect-correct", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/otelk/mt-error-detect-correct
- SGLang
How to use otelk/mt-error-detect-correct 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 "otelk/mt-error-detect-correct" \ --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": "otelk/mt-error-detect-correct", "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 "otelk/mt-error-detect-correct" \ --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": "otelk/mt-error-detect-correct", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use otelk/mt-error-detect-correct with Docker Model Runner:
docker model run hf.co/otelk/mt-error-detect-correct
MT Error Detection and Correction Models
This repository contains models for machine translation error detection and error correction.
Repository Structure
error_detection/
βββ model/ # Model for translation error detection
βββ lora/ # GRPO LoRA adapter for error detection
error_correction/
βββ model/ # Model for translation error correction
βββ lora/ # GRPO LoRA adapter for error correction
Usage
The repository contains two components:
error_detection: machine translation error detectionerror_correction: machine translation error correction
Installation
pip install transformers huggingface_hub vllm
Load a Model
First download the repository:
import os
from huggingface_hub import snapshot_download
from transformers import AutoTokenizer
from vllm import LLM
from vllm.lora.request import LoRARequest
repo_dir = snapshot_download(
repo_id="otelk/mt-error-detect-correct"
)
For error detection:
model_dir = os.path.join(repo_dir, "error_detection", "model")
adapter_dir = os.path.join(repo_dir, "error_detection", "lora")
For error correction:
model_dir = os.path.join(repo_dir, "error_correction", "model")
adapter_dir = os.path.join(repo_dir, "error_correction", "lora")
tokenizer = AutoTokenizer.from_pretrained(
model_dir,
trust_remote_code=True
)
llm = LLM(
model=model_dir,
tokenizer=model_dir,
dtype="bfloat16",
enable_lora=True,
max_lora_rank=16,
trust_remote_code=True
)
lora_request = LoRARequest(
"mt_lora",
1,
adapter_dir
)
The model can then be used with vLLM by passing the corresponding lora_request during generation.
outputs = llm.generate(
prompts,
sampling_params=sampling_params,
lora_request=lora_request
)