Instructions to use ajayk0608/parchi-v3-LoRA with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use ajayk0608/parchi-v3-LoRA with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("Qwen/Qwen2.5-0.5B-Instruct") model = PeftModel.from_pretrained(base_model, "ajayk0608/parchi-v3-LoRA") - Notebooks
- Google Colab
- Kaggle
parchi-v3-LoRA
Parchi reads the purchase note a grocery (kirana) shopkeeper types to a supplier, in Hinglish, English or Telugu (script or romanised), and returns the order as JSON: vendor, plus item, quantity, unit, rupee rate and brand (as written in the note) for each line.
It is Qwen2.5-0.5B-Instruct fine-tuned with LoRA (r=16) on 5,250 generated notes over a 420-item catalogue, trained on a laptop CPU, then merged. Scores are exact match on notes written by hand that the model never saw: every field of every line has to be right. Hinglish set: 34 notes; Telugu set: 36 notes.
This repo is the LoRA adapter that ajayk0608/parchi-v3 was merged from: only the fine-tuned weights, which run on top of Qwen/Qwen2.5-0.5B-Instruct. It gives the same answers as the merged model. Use it to fine-tune further, to compare adapters over one base model, or when you already have the base model and want a small download. To run the model without PEFT, use ajayk0608/parchi-v3 (Python) or ajayk0608/parchi-v3-GGUF (llama.cpp, Ollama, LM Studio).
Training
| Base model | Qwen/Qwen2.5-0.5B-Instruct |
| LoRA | r 16, alpha 32, dropout 0.05; q_proj, k_proj, v_proj, o_proj, gate_proj, up_proj, down_proj |
| Trainable parameters | 8.8 M of 503 M (1.7%) |
| Start | warm start from the v2 adapter |
| Data | 5250 generated notes; eval loss measured on 40 validation notes |
| Schedule | 1 epoch, lr 0.0001, cosine with 5% warm-up, AdamW, batch 4 Γ gradient accumulation 2 |
| Loss | cross-entropy on the JSON answer tokens only (the prompt is masked) |
| Hardware | float32 on a 4-core laptop CPU |
Which build should I use?
| File | Build | Size | Best for | Hinglish exact | Telugu exact |
|---|---|---|---|---|---|
| parchi-v3 | Full model (safetensors) | 953 MB | Developers in Python, servers, and anyone fine-tuning further | 65% | 78% |
| parchi-v3-LoRA | LoRA adapter (PEFT) | 44 MB | Builders who fine-tune further or already have Qwen2.5-0.5B-Instruct | 65% | 78% |
parchi-v3-f16.gguf |
F16 GGUF | 948 MB | People who want to make their own quantized builds | β | β |
parchi-v3-q8_0.gguf |
Q8_0 | 506 MB | Laptops and desktops, shop-counter PCs, servers without a GPU | 65% | 78% |
parchi-v3-q6_k.gguf |
Q6_K | 482 MB | Newer phones (6 GB RAM or more) and small office PCs | 65% | 69% |
parchi-v3-q5_k_m.gguf |
Q5_K_M | 400 MB | Mid-range phones (4 to 6 GB RAM) that want accuracy first | 62% | 75% |
parchi-v3-q4_k_m.gguf β |
Q4_K_M | 379 MB | Most phones: the default choice for an on-device app | 59% | 61% |
parchi-v3-q4_0.gguf |
Q4_0 | 335 MB | Older or budget Android phones (3 to 4 GB RAM), Raspberry Pi | 41% | 50% |
β = the default for a phone app.
The hand-written sets are small (34 and 36 notes), so one note moves a score by about 3 points. Builds within a few points of each other perform the same, and a quantized build scoring above the full model is noise, not an improvement.
v3 compared with v2: Telugu exact 64% β 78%, Hinglish exact 74% β 65%. v3 adds the brand field and grows the catalogue from 64 to 420 items, but it is not better everywhere: on the Hinglish set, v2 still reads more notes exactly.
Prompt
Always send this system prompt (the model was trained with it), then the note as the user message. Use greedy decoding (temperature 0).
You read a kirana (grocery) shop purchase note, often in Hinglish or Telugu, and return the order as JSON only. Schema: {"vendor": string or null, "lines": [{"item": string, "qty": number, "unit": string, "rate": number or null, "brand": string or null}]}. item is the canonical English name; unit is one of kg, g, l, ml, pcs, dozen, packet, bottle, bunch, box; rate is the rupee price per unit if stated, else null; brand is the brand name exactly as written in the note, else null (loose and organic are not brands); vendor is who the note is addressed to, else null.
Example output:
{"vendor":"Sharma Store","lines":[{"item":"wheat flour","qty":10,"unit":"kg","rate":null,"brand":"Aashirvaad"},{"item":"mustard oil","qty":1,"unit":"l","rate":165,"brand":null}]}
Use with PEFT
from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel
base = AutoModelForCausalLM.from_pretrained("Qwen/Qwen2.5-0.5B-Instruct")
model = PeftModel.from_pretrained(base, "ajayk0608/parchi-v3-LoRA")
tok = AutoTokenizer.from_pretrained("ajayk0608/parchi-v3-LoRA")
SYSTEM = "..." # the system prompt above
msgs = [{"role": "system", "content": SYSTEM}, {"role": "user", "content": "bhai 5 kg chini aur 2 dzn ande bhej do, chini 42 ka"}]
enc = tok.apply_chat_template(msgs, add_generation_prompt=True, return_tensors="pt", return_dict=True)
out = model.generate(**enc, max_new_tokens=256, do_sample=False)
print(tok.decode(out[0, enc["input_ids"].shape[1]:], skip_special_tokens=True))
Merge it into a standalone model with model.merge_and_unload().save_pretrained("parchi-merged"); that is exactly how ajayk0608/parchi-v3 was made.
Limits
- Knows the 420 catalogue items and their spellings; an unknown item is guessed onto a known one.
- One order per note, up to about six lines; rates are per unit as written.
- Trained on generated notes: real notes can surface patterns it has not seen (common misses: the next line's number taken as a rate, near-neighbour Telugu spellings, brand-only items).
- Brand is returned exactly as written; it is not checked against a brand list here, and the scores above do not grade it (the hand-written sets have no brand labels yet). Loose, organic and egg kinds are not brands, so brand is null.
- Downloads last month
- 76