Skip to content

Commit c07895d

Browse files
Copilotnmdra
andauthored
Add Ollama Modelfile details to README
Agent-Logs-Url: https://github.com/nmdra/Assignment-Metadata-Extractor/sessions/812499ea-9d6c-4d28-9de1-340d8e462765 Co-authored-by: nmdra <73674803+nmdra@users.noreply.github.com>
1 parent 82bd821 commit c07895d

1 file changed

Lines changed: 38 additions & 0 deletions

File tree

README.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,44 @@ uv run python training/train.py
5757
- `./smollm-student-extractor/` (Hugging Face model/tokenizer)
5858
- `./smollm-student-gguf/` (GGUF export for Ollama)
5959

60+
## Ollama Modelfile
61+
62+
Create a `Modelfile` with the following content:
63+
64+
```text
65+
FROM hf.co/nimendraai/SmolLM2-360M-Assignment-Metadata-Extractor:Q4_K_M
66+
67+
# Apply the strict instruction template used during training
68+
TEMPLATE """### Instruction:
69+
Extract student info as JSON from the following text.
70+
71+
### Input:
72+
{{ .Prompt }}
73+
74+
### Response:
75+
"""
76+
77+
# Set the System constraints
78+
SYSTEM """
79+
You are a precise student assignment data extractor.
80+
Output ONLY a valid JSON object. No explanation. No extra text. No markdown.
81+
Always output exactly: {"student_number":"...","student_name":"...","assignment_number":"..."}
82+
"""
83+
84+
# Turn off creativity
85+
PARAMETER temperature 0
86+
87+
# Stop generating once the JSON is closed
88+
PARAMETER stop "}"
89+
```
90+
91+
Build and run with Ollama:
92+
93+
```bash
94+
ollama create assignment-metadata-extractor -f Modelfile
95+
ollama run assignment-metadata-extractor
96+
```
97+
6098
## Dataset format
6199

62100
`data/generate_dataset.py` creates a JSON list where each item contains:

0 commit comments

Comments
 (0)