Instructions to use johnbean393/chiboard-1-m2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use johnbean393/chiboard-1-m2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="johnbean393/chiboard-1-m2") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("johnbean393/chiboard-1-m2") model = AutoModelForCausalLM.from_pretrained("johnbean393/chiboard-1-m2") 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 johnbean393/chiboard-1-m2 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "johnbean393/chiboard-1-m2" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "johnbean393/chiboard-1-m2", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/johnbean393/chiboard-1-m2
- SGLang
How to use johnbean393/chiboard-1-m2 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 "johnbean393/chiboard-1-m2" \ --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": "johnbean393/chiboard-1-m2", "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 "johnbean393/chiboard-1-m2" \ --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": "johnbean393/chiboard-1-m2", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use johnbean393/chiboard-1-m2 with Docker Model Runner:
docker model run hf.co/johnbean393/chiboard-1-m2
Chiboard-1 M2
Final 350M Chiboard M2 model for Chinese pinyin-to-Hanzi conversion and
revision. It was initialized from
johnbean393/chiboard-1-s1
and trained with correctness-gated, off-policy distillation from
johnbean393/chiboard-1-t1.
This is the final M2 artifact and has completed the full validation protocol: one million training examples, integrity checks, and four frozen 140K SGLang evaluations. Validation-complete does not mean statistically proven superior to S1: its final point estimate is directionally better, but the predeclared 95% confidence interval includes zero and the superiority gate did not pass.
Prompt format
<|startoftext|>{committed_context}<|reserved_6|>{raw_pinyin}<|reserved_7|>{display}<|reserved_8|>{target}<|im_end|>
The tokenizer adds exactly one BOS. At inference time, stop the prompt after
<|reserved_8|> and greedily generate through <|im_end|>.
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
model_id = "johnbean393/chiboard-1-m2"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(
model_id,
torch_dtype=torch.bfloat16,
device_map="auto",
)
committed_context = ""
raw_pinyin = "nihao"
display = ""
prompt = (
f"{committed_context}<|reserved_6|>{raw_pinyin}"
f"<|reserved_7|>{display}<|reserved_8|>"
)
inputs = tokenizer(prompt, return_tensors="pt", add_special_tokens=True).to(model.device)
outputs = model.generate(
**inputs,
do_sample=False,
max_new_tokens=96,
eos_token_id=tokenizer.convert_tokens_to_ids("<|im_end|>"),
pad_token_id=tokenizer.pad_token_id,
)
completion = outputs[0, inputs.input_ids.shape[1]:]
print(tokenizer.decode(completion, skip_special_tokens=True))
For a pure-pinyin active buffer, display is empty. For revision use, display
contains the currently displayed Hanzi text to be corrected.
Training
- Student initialization and frozen retention reference:
johnbean393/chiboard-1-s1atac4e8c3885ef1a0ad5b3f90a1e4c5639ae669edd. - Teacher:
johnbean393/chiboard-1-t1at4086865d8813a01909a420579ee7b15821bf80b0. - Exposure: 500,000 plain + 500,000 revision examples, balanced and document-disjoint from the training shadow evaluation.
- Gold NLL on every completion token, including EOS.
- Teacher candidate-set forward KL only where T1's top token is gold and frozen S1's top token is not gold.
- Frozen-S1 retention KL on S1-correct tokens.
- Candidate/retention top-k 8; teacher temperature 2.0; teacher weight 1.0; retention temperature 1.0; retention weight 0.1.
- Peak LR
3e-7, 2% warmup, cosine decay to3e-8over 30,000 examples, then held at3e-8through 1,000,000 examples. - 7,810 optimizer updates; three isolated clipped updates; no consecutive clipping or numerical instability.
The complete sanitized configuration and lineage are in
training_summary.json.
Chiboard evaluation
The model was evaluated using the frozen
johnbean393/chiboard-1-eval
campaign sample: 100,000 plain and 40,000 revision rows, seed 20260714.
Decoding used SGLang 0.5.9, BF16, greedy generation, the native model
implementation, default FA3 attention, and shuffled request order.
| Cohort | Exact match | CER | Delta EM vs S1 | Delta CER vs S1 |
|---|---|---|---|---|
| Plain | 54.9171% | 0.133746 | +0.0757 pp | -0.0350 pp |
| Revision | 54.6658% | 0.076984 | -0.0134 pp | -0.0432 pp |
| Hard ambiguity | 52.0561% | 0.139144 | +0.0839 pp | -0.0337 pp |
Combined utility versus S1 was +0.258 pp, with a 95% paired document-bootstrap CI of [-0.019, +0.546] pp. The gate verdict was FAIL because its lower bound did not exceed zero. There were no non-inferiority guard violations.
The exact SGLang manifest, report, and gate verdict are included under
evaluation/.
Weights
- Format: safetensors
- Tensor file size: 708,984,464 bytes
- SHA-256:
427331f979b1909bf400e94e43828bca397e97d03a0b68e103d3b2dd07ca85b8
Training telemetry:
W&B run.
- Downloads last month
- 108