Text Generation
Transformers
Safetensors
English
nano-proofread
grammar-correction
proofreading
homophones
tiny
byte-level
from-scratch
Instructions to use vukrosic/nano-proofread with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use vukrosic/nano-proofread with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="vukrosic/nano-proofread")# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("vukrosic/nano-proofread", dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use vukrosic/nano-proofread with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "vukrosic/nano-proofread" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "vukrosic/nano-proofread", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/vukrosic/nano-proofread
- SGLang
How to use vukrosic/nano-proofread 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 "vukrosic/nano-proofread" \ --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": "vukrosic/nano-proofread", "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 "vukrosic/nano-proofread" \ --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": "vukrosic/nano-proofread", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use vukrosic/nano-proofread with Docker Model Runner:
docker model run hf.co/vukrosic/nano-proofread
| { | |
| "model_type": "nano-proofread", | |
| "architecture": "decoder-only transformer (pre-norm)", | |
| "vocab_size": 256, | |
| "tokenizer": "byte (raw UTF-8 bytes, no vocab file)", | |
| "dim": 128, | |
| "n_layers": 4, | |
| "n_heads": 4, | |
| "n_kv_heads": 2, | |
| "head_dim": 32, | |
| "ffn": "swiglu", | |
| "ffn_mult": 4, | |
| "norm": "rmsnorm", | |
| "norm_eps": 1e-05, | |
| "positional": "rope", | |
| "rope_theta": 10000.0, | |
| "max_seq_len": 64, | |
| "tie_word_embeddings": true, | |
| "params": 1016960, | |
| "training": { | |
| "task": "short phrase with one common writing error -> corrected phrase", | |
| "scope": "fixed set of context-dependent confusions (their/there/they're, your/you're, its/it's, then/than, to/too, could have/could of) plus doubled words; NOT general grammar correction", | |
| "data": "100% code-generated: build a grammatically-correct phrase from templates with rich slot fillers, then inject one error (swap a confusion word for a wrong family member, or double a word); ~15% identity; label correct by construction", | |
| "objective": "SFT, prompt-masked cross-entropy (only the corrected phrase + newline EOS supervised)", | |
| "steps": 16000, | |
| "batch_size": 64, | |
| "seq_len": 64, | |
| "optimizer": "adamw", | |
| "lr": 0.003, | |
| "schedule": "cosine", | |
| "warmup_steps": 200, | |
| "seed": 0 | |
| } | |
| } | |