Instructions to use UnimeType/Transliteration-4B-Safetensors with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use UnimeType/Transliteration-4B-Safetensors with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="UnimeType/Transliteration-4B-Safetensors") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("UnimeType/Transliteration-4B-Safetensors") model = AutoModelForCausalLM.from_pretrained("UnimeType/Transliteration-4B-Safetensors", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use UnimeType/Transliteration-4B-Safetensors with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "UnimeType/Transliteration-4B-Safetensors" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "UnimeType/Transliteration-4B-Safetensors", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/UnimeType/Transliteration-4B-Safetensors
- SGLang
How to use UnimeType/Transliteration-4B-Safetensors 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 "UnimeType/Transliteration-4B-Safetensors" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "UnimeType/Transliteration-4B-Safetensors", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'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 "UnimeType/Transliteration-4B-Safetensors" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "UnimeType/Transliteration-4B-Safetensors", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use UnimeType/Transliteration-4B-Safetensors with Docker Model Runner:
docker model run hf.co/UnimeType/Transliteration-4B-Safetensors
UnimeType Transliteration-4B · Safetensors
Convert Latin-character messages into Chinese, Japanese, Hindi, or Arabic script on your own computer. Transliteration-4B is UnimeType's 4B-class model for Pinyin, Romaji, Romanized Hindi, Hinglish, and Arabizi. Its task is conversion, with English words, links, code, numbers, and punctuation intended to stay in place. Review the output before using it; preservation is not guaranteed.
Choose your format
| Download | Contents |
|---|---|
| Safetensors | Floating-point text-model weights and tokenizer |
| GGUF | Q8_0 file for llama.cpp |
| MLX | Existing 6-bit Apple silicon release |
Run on Apple silicon
We loaded these Safetensors files with MLX-LM 0.31.3 / MLX 0.32.2 on an Apple M5 Pro MacBook Pro with 48 GB memory. The model-type override below selects MLX's Qwen3.5 text loader for this Hugging Face layout.
from mlx_lm import load, generate
model, tokenizer = load(
"UnimeType/Transliteration-4B-Safetensors",
model_config={"model_type": "qwen3_5"},
)
messages = [
{"role": "system", "content": "Convert Pinyin to Simplified Chinese. Preserve clear English, URLs, code, numbers, punctuation and line breaks. Return only the converted text. Do not translate, polish or explain."},
{"role": "user", "content": "jintian yao finish README"},
]
prompt = tokenizer.apply_chat_template(
messages, tokenize=False, add_generation_prompt=True, enable_thinking=False
)
print(generate(model, tokenizer, prompt=prompt, max_tokens=128))
This is a standalone usage example, not UnimeType's production prompt or a scored test. Change the task instruction to Japanese Romaji, Romanized Hindi, or Arabizi for another target. This model is for Convert, not Polish or Explain.
Transformers 5.16.1 with PyTorch 2.11.0 also loaded this checkpoint with no missing or unexpected weights:
import torch
from transformers import AutoTokenizer, Qwen3_5ForCausalLM
repo = "UnimeType/Transliteration-4B-Safetensors"
tokenizer = AutoTokenizer.from_pretrained(repo)
model = Qwen3_5ForCausalLM.from_pretrained(repo, dtype=torch.bfloat16)
The Transformers check covers loading, not a completed inference benchmark. NVIDIA CUDA, AMD ROCm, iOS, and Android inference are unverified. No minimum-memory or speed claim is made.
Validation and known limits
These exported weights passed an exact 426-tensor round-trip check against the retained fine-tuned source. We also ran a production Convert request through the exported weights using native MLX, with thinking disabled, temperature 0, and a 1,024-token output budget. An Arabic context case returned an extra trailing newline and failed the production output-format check. The BF16 GGUF export reproduced that failure under the same request.
No full-suite accuracy score is available for this Safetensors release. Scores from the MLX 6-bit and GGUF Q8_0 versions do not establish its accuracy. The release family also has errors on ambiguous short English inputs, Arabic dialect and spelling choices, and Japanese punctuation or emoji preservation. Check links, code, numbers, punctuation, and line breaks before accepting replacements.
Weight origin and license
These are the retained fine-tuned weights, exported into the Hugging Face text-model layout. The source contains 402 BF16 tensors and 24 FP32 tensors. Its LoRA fine-tuning used a quantized 4-bit Qwen3.5-4B base, followed by floating-point fusion. Floating-point storage does not restore the original base model's pre-quantization precision. This export is not a dequantization of the public MLX 6-bit model and is not the untuned Qwen base model.
The exact original base snapshot revision was not recorded. PROVENANCE.json identifies the retained source by SHA-256. SHA256SUMS lists checksums for the public files. The model is text-only; it contains no vision or auxiliary MTP weights.
The base model's Apache 2.0 license is included in LICENSE.
训练数据集未公开。 The training dataset is not publicly released. This repository contains model and runtime files, documentation, provenance, checksums, and the license. It does not include datasets, data-generation scripts, training code, or training logs.
- Downloads last month
- 214