Instructions to use amiya/qwen2.5-3b-gec-bea2019 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use amiya/qwen2.5-3b-gec-bea2019 with MLX:
# Make sure mlx-lm is installed # pip install --upgrade mlx-lm # Generate text with mlx-lm from mlx_lm import load, generate model, tokenizer = load("amiya/qwen2.5-3b-gec-bea2019") prompt = "Write a story about Einstein" messages = [{"role": "user", "content": prompt}] prompt = tokenizer.apply_chat_template( messages, add_generation_prompt=True ) text = generate(model, tokenizer, prompt=prompt, verbose=True) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- LM Studio
- Pi
How to use amiya/qwen2.5-3b-gec-bea2019 with Pi:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "amiya/qwen2.5-3b-gec-bea2019"
Configure the model in Pi
# Install Pi: npm install -g @mariozechner/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "mlx-lm": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "amiya/qwen2.5-3b-gec-bea2019" } ] } } }Run Pi
# Start Pi in your project directory: pi
- OpenClaw new
How to use amiya/qwen2.5-3b-gec-bea2019 with OpenClaw:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "amiya/qwen2.5-3b-gec-bea2019"
Configure OpenClaw
# Install OpenClaw: npm install -g openclaw@latest # Register the local server and set it as the default model: openclaw onboard --non-interactive --mode local \ --auth-choice custom-api-key \ --custom-base-url http://127.0.0.1:8080/v1 \ --custom-model-id "amiya/qwen2.5-3b-gec-bea2019" \ --custom-provider-id mlx-lm \ --custom-compatibility openai \ --custom-text-input \ --accept-risk \ --skip-health
Run OpenClaw
openclaw agent --local --agent main --message "Hello from Hugging Face"
- MLX LM
How to use amiya/qwen2.5-3b-gec-bea2019 with MLX LM:
Generate or start a chat session
# Install MLX LM uv tool install mlx-lm # Interactive chat REPL mlx_lm.chat --model "amiya/qwen2.5-3b-gec-bea2019"
Run an OpenAI-compatible server
# Install MLX LM uv tool install mlx-lm # Start the server mlx_lm.server --model "amiya/qwen2.5-3b-gec-bea2019" # Calling the OpenAI-compatible server with curl curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "amiya/qwen2.5-3b-gec-bea2019", "messages": [ {"role": "user", "content": "Hello"} ] }' - Hermes Agent
How to use amiya/qwen2.5-3b-gec-bea2019 with Hermes Agent:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "amiya/qwen2.5-3b-gec-bea2019"
Configure Hermes
# Install Hermes: curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash hermes setup # Point Hermes at the local server: hermes config set model.provider custom hermes config set model.base_url http://127.0.0.1:8080/v1 hermes config set model.default amiya/qwen2.5-3b-gec-bea2019
Run Hermes
hermes
- Atomic Chat
qwen2.5-3b-gec-bea2019
LoRA fine-tune of Qwen/Qwen2.5-3B-Instruct for English grammatical error correction (GEC). Trained on the W&I+LOCNESS subset of BEA-2019 (33,432 minimal-edit pairs). LoRA weights are fused into the base, so this repo is a drop-in replacement for the base model.
Results
ERRANT scores on a 100-sample held-out BEA-dev split (sampled from ABCN.dev.gold.bea19.m2):
| Metric | Value |
|---|---|
| Precision | 0.543 |
| Recall | 0.365 |
| F0.5 | 0.4950 |
Validation loss converged from 2.875 (baseline) to 0.281 over 3,000 LoRA iters on an Apple M2 Max in ~17 minutes.
Use
from mlx_lm import generate, load
model, tokenizer = load("amiya/qwen2.5-3b-gec-bea2019")
prompt = tokenizer.apply_chat_template(
[
{"role": "system", "content": "Correct the grammar of the user text. Preserve meaning."},
{"role": "user", "content": "He go to school"},
],
tokenize=False,
add_generation_prompt=True,
)
print(generate(model, tokenizer, prompt=prompt, max_tokens=80))
# -> "He goes to school"
PyTorch users: transformers.AutoModelForCausalLM.from_pretrained("amiya/qwen2.5-3b-gec-bea2019") works the same way.
System prompt
The model was trained with the system prompt:
Correct the grammar of the user text. Preserve meaning.
Use that exact prompt for in-distribution behavior. The chat template is Qwen's ChatML.
Smoke samples
| Input | Output |
|---|---|
He go to school |
He goes to school |
I are happy |
I am happy |
she walk fast |
She walks fast . |
they was tired yesterday |
They were tired yesterday . |
she have a cat |
She has a cat . |
Trailing-space + period is a BEA-2019 tokenization artifact; a post-processor can strip it.
Training
- Base:
Qwen/Qwen2.5-3B-Instruct(3.09 B params) - LoRA: rank 16, alpha 32, 16 layers, 6.65 M trainable params (0.216 %)
- Optimizer: AdamW, lr 5e-5
- Batch size: 2, max sequence 256
- Iters: 3,000
- Hardware: Apple M2 Max, 32 GB unified RAM, mlx-lm v0.31.3
- Data: BEA-2019 W&I+LOCNESS
ABC.train.gold.bea19.m2, converted to ChatML SFT by the data-pipeline repo. 33,432 minimal-edit (src, tgt) pairs after dropping identity rows. - Wall-clock: 17 minutes solo (3.2 it/s).
Limitations
- F0.5 = 0.4950 is below the GECToR paper's 0.65+ benchmark. That gap is expected: the published number comes from a multi-stage curriculum (C4_200M pretrain → BEA-2019 → W&I+L fine-tune) on a token-classification head. This run is a single LoRA pass with seq2seq generation. Closing the gap needs more data (NUCLE, FCE, Lang-8) and the multi-stage recipe.
- Greedy decoding is recommended. Temperature > 0 produces fluent but less-faithful corrections.
- English only.
- Trained on ≤ 256-token sequences; long inputs may degrade.
Citation
@misc{qwen25_3b_gec_bea2019,
title = {qwen2.5-3b-gec-bea2019: LoRA-tuned Qwen2.5-3B for English GEC},
author = {amiya},
year = {2026},
url = {https://huggingface.co/amiya/qwen2.5-3b-gec-bea2019}
}
Underlying corpus: Bryant, Felice, Andersen, Briscoe. The BEA-2019 Shared Task on Grammatical Error Correction, BEA 2019.
- Downloads last month
- 8
Quantized