Instructions to use davidr99/qwen35-address-std-2B-v3 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use davidr99/qwen35-address-std-2B-v3 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="davidr99/qwen35-address-std-2B-v3") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("davidr99/qwen35-address-std-2B-v3") model = AutoModelForMultimodalLM.from_pretrained("davidr99/qwen35-address-std-2B-v3") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] inputs = processor.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(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use davidr99/qwen35-address-std-2B-v3 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "davidr99/qwen35-address-std-2B-v3" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "davidr99/qwen35-address-std-2B-v3", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/davidr99/qwen35-address-std-2B-v3
- SGLang
How to use davidr99/qwen35-address-std-2B-v3 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 "davidr99/qwen35-address-std-2B-v3" \ --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": "davidr99/qwen35-address-std-2B-v3", "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 "davidr99/qwen35-address-std-2B-v3" \ --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": "davidr99/qwen35-address-std-2B-v3", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Unsloth Studio
How to use davidr99/qwen35-address-std-2B-v3 with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for davidr99/qwen35-address-std-2B-v3 to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for davidr99/qwen35-address-std-2B-v3 to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for davidr99/qwen35-address-std-2B-v3 to start chatting
Load model with FastModel
pip install unsloth from unsloth import FastModel model, tokenizer = FastModel.from_pretrained( model_name="davidr99/qwen35-address-std-2B-v3", max_seq_length=2048, ) - Docker Model Runner
How to use davidr99/qwen35-address-std-2B-v3 with Docker Model Runner:
docker model run hf.co/davidr99/qwen35-address-std-2B-v3
qwen35-address-std-2B-v3
Superseded by
davidr99/qwen35-address-std-4B-v5(99.2% exact-match, no city-spelling drift, trimmed output). This repo is kept for A/B comparison.
Qwen3.5 fine-tune (LoRA, merged 16-bit) for two US-address tasks, selected by the
system prompt: normalize (raw US address -> strict JSON of standardized components,
PostGIS address_standardizer stdaddr schema) and compare (two addresses -> per-bucket
MATCH/PLAUSIBLE/NOT_MATCHED verdicts).
Trained on dataset revision v3 (pinned tag on both datasets above).
Output contract (this version): every one of the 16 keys is always present; absent
fields are "". (v5+ models switched to omitting empty keys.)
This version (v3): first model with 100% US city coverage (all ~18.6k city names guaranteed in train via a one-row-per-place coverage pass over ~30k real city/state/ZIP triples), plus directional-word street names (W North St), state-name highways (Ohio 78), type-word-in-name streets (Ashford Glen Circle Drive), and premise-token variety.
Results
Cross-version eval on the v4 split: 94.9% -- misses were concentrated in v4-only patterns this model never trained on (route qualifiers, single-letter names), so it understates same-version accuracy. On that harder split it still scored 99.3% on city with zero spelling garbles, the first evidence the coverage pass fixed city copying.
Version history
| Model | Data | Normalize exact-match | Notes |
|---|---|---|---|
2B (v1, qwen35-address-std) |
v1 | ~98.9%* | first release; *dev harness, ~760-row val |
| 2B-v2 | v2 | 98.0% | USPS suffixes + prompt rules; 761-row val |
| 2B-v3 | v3 | 94.9%** | first 100% city coverage; **cross-version eval on the v4 split (v4-only patterns untrained) |
| 2B-v4 | v4 | 98.8% | PostGIS-grammar patterns; 2,139-row val |
| 4B-v4 | v4 | 99.3% | first 4B; city-spelling garbles eliminated |
| 2B-v5 | v5 | 98.6% | trimmed JSON (43% fewer output tokens); fastest |
| 4B-v5 (current) | v5 | 99.2% | garble-free + trimmed output -- recommended |
Normalize system prompt (verbatim, as trained)
You standardize a single raw US address string into structured components.
Return ONLY a JSON object with these exact keys (always include every key; use "" when absent):
building, houseNum, predir, qual, pretype, name, suftype, sufdir,
ruralRoute, extra, city, state, country, zipcode, box, unit
Field meanings & rules:
- building: a named building/place that precedes the street address (e.g. "EMPIRE STATE BUILDING").
- houseNum: the primary street number.
- predir: directional BEFORE the street name (N, S, E, W, NE, NW, SE, SW).
- qual: a qualifier adjective before the name that is not a type or directional (e.g. "OLD", "NEW").
- pretype: street type or route descriptor BEFORE the name (e.g. "AVE", "US RTE", "STATE RTE").
- name: the core street name (or the route number for numbered routes/interstates).
- suftype: street type AFTER the name (e.g. "ST", "RD", "AVE", "BLVD").
- sufdir: directional AFTER the street (post-directional), e.g. "NW" in "Pennsylvania Ave NW".
- ruralRoute: the rural route NUMBER only (e.g. "2" for "RR 2", "1" for "HC 1").
- extra: extra information such as a floor; for an intersection it holds the cross street prefixed with "&" (e.g. "& 5TH AVE").
- city / state / zipcode: the locality, 2-letter state, and ZIP.
- country: always "USA".
- box: a post-office / route box, normalized to "BOX <number>" (e.g. "BOX 152"); drop any "PO"/"P.O." prefix.
- unit: secondary unit (e.g. "APT 5B", "STE 200"), OR any leftover token trailing the street type.
Normalization rules:
- UPPERCASE every value; abbreviate street types and directionals to USPS abbreviations.
- Preserve the original spelling of names and places: copy name, city, and other
free-text values exactly as written (only uppercased). Do NOT fix typos, expand,
or change spelling. (Street types and directionals are still abbreviated as above.)
- "St"/"Saint" before a name is part of the name ("ST CHARLES"), not the type "ST".
- street type before the name -> pretype; after the name -> suftype.
- directional AFTER the street (and after the suftype) -> sufdir (e.g. "NW" in "Pennsylvania Ave NW").
- numbered route -> descriptor in pretype ("US RTE", "STATE RTE", "COUNTY RD", "TWP RD", "INTERSTATE"), number (keep any letter suffix, e.g. "75A") in name.
- intersection of two streets -> primary street in predir/qual/name/suftype; cross street in
extra as "& <CROSS STREET>" (e.g. "& 5TH AVE"); houseNum stays empty.
- any leftover token trailing the street type -> unit (whatever it is).
- the city is the locality right before the state/ZIP; output it even when it looks like a state name ("Kansas, OK" -> city KANSAS) or is short/lowercase ("ary, KY" -> city ARY).
- zipcode may include a ZIP+4 suffix (e.g. "44646-1234"); keep it if present, else use the 5-digit ZIP or "".
- country is always "USA".
- only output fields that are present: never infer or guess a missing city, state, ZIP, or any field from the others -- leave it "" if it is not in the input.
- output ONLY the JSON object: no code fences, markdown, comments, or any text before or after it.
The compare-task system prompt for this version is embedded in every row of
davidr99/us-address-comparison (the system field) at the matching revision.
Usage
See the usage snippet on the current release's card -- identical apart from the repo name (greedy decoding, enable_thinking=False, use the inner text tokenizer of the multimodal processor). eval_address_model.ipynb in this repo family scores any version against any dataset tag.
- Downloads last month
- 9