Update README.md
Browse files
README.md
CHANGED
|
@@ -1,3 +1,85 @@
|
|
| 1 |
-
---
|
| 2 |
-
license: mit
|
| 3 |
-
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: mit
|
| 3 |
+
---
|
| 4 |
+
# AI Math Tutor for Early Learners
|
| 5 |
+
|
| 6 |
+
**Numeracy-tuned small language model** for short, child-friendly math explanations.
|
| 7 |
+
This repository contains the **merged float16** checkpoint (all weights in one folder: `model.safetensors` + config + tokenizer files).
|
| 8 |
+
|
| 9 |
+
| | |
|
| 10 |
+
|---|---|
|
| 11 |
+
| **Model page** | [https://huggingface.co/AddisuSeteye/AI_Math_Tutor_for_Early_Learners](https://huggingface.co/AddisuSeteye/AI_Math_Tutor_for_Early_Learners) |
|
| 12 |
+
| **Source code** | [https://github.com/AdaSeteye/AI_Math_Tutor_for_Early_Learners](https://github.com/AdaSeteye/AI_Math_Tutor_for_Early_Learners) |
|
| 13 |
+
| **License** | MIT |
|
| 14 |
+
|
| 15 |
+
## Model details
|
| 16 |
+
|
| 17 |
+
- **Architecture:** `GPT2LMHeadModel` (6 layers, 768 hidden size, 12 attention heads) — same family as [distilgpt2](https://huggingface.co/distilgpt2) used as the base for the training pipeline in this project.
|
| 18 |
+
- **Format:** Merged full model in **FP16** (`model.safetensors`), with `config.json`, `generation_config.json`, and tokenizer files.
|
| 19 |
+
- **Training:** Supervised fine-tuning with **LoRA** (QLoRA when 4-bit is available), then **merge** into a single Hugging Face–compatible directory (`merged_f16`).
|
| 20 |
+
- **Training data:** `numeracy_instruct.jsonl` — short user/assistant **chat-style** turns (counting, addition, subtraction, simple word problems) for early numeracy.
|
| 21 |
+
- **Intended use:** Prototype / teaching demo for an **AI Math Tutor** context; not a production safety-critical system for unsupervised use with children without human oversight.
|
| 22 |
+
|
| 23 |
+
## Files in this repo (upload from `merged_f16`)
|
| 24 |
+
|
| 25 |
+
| File | Role |
|
| 26 |
+
|------|------|
|
| 27 |
+
| `model.safetensors` | Merged model weights (FP16) |
|
| 28 |
+
| `config.json` | Model configuration |
|
| 29 |
+
| `generation_config.json` | Default generation settings |
|
| 30 |
+
| `tokenizer.json` | Tokenizer (JSON) |
|
| 31 |
+
| `tokenizer_config.json` | Tokenizer config |
|
| 32 |
+
|
| 33 |
+
## How to use
|
| 34 |
+
|
| 35 |
+
```python
|
| 36 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 37 |
+
import torch
|
| 38 |
+
|
| 39 |
+
model_id = "AddisuSeteye/AI_Math_Tutor_for_Early_Learners"
|
| 40 |
+
|
| 41 |
+
tokenizer = AutoTokenizer.from_pretrained(model_id)
|
| 42 |
+
model = AutoModelForCausalLM.from_pretrained(
|
| 43 |
+
model_id,
|
| 44 |
+
torch_dtype=torch.float16,
|
| 45 |
+
device_map="auto",
|
| 46 |
+
)
|
| 47 |
+
|
| 48 |
+
# Example: single-turn style prompt (match your training format in practice)
|
| 49 |
+
text = "You are a math helper. How many is 2 + 1?"
|
| 50 |
+
inputs = tokenizer(text, return_tensors="pt").to(model.device)
|
| 51 |
+
out = model.generate(**inputs, max_new_tokens=80, do_sample=True, top_p=0.9)
|
| 52 |
+
print(tokenizer.decode(out[0], skip_special_tokens=True))
|
| 53 |
+
```
|
| 54 |
+
|
| 55 |
+
### Requirements
|
| 56 |
+
|
| 57 |
+
- `transformers` (version compatible with your `config.json`, e.g. 4.36+)
|
| 58 |
+
- `torch`
|
| 59 |
+
- `safetensors` (for loading `.safetensors`)
|
| 60 |
+
|
| 61 |
+
## Limitations
|
| 62 |
+
|
| 63 |
+
- Trained for **short** numeracy-style responses; may **hallucinate** or be incorrect on out-of-distribution questions.
|
| 64 |
+
- **Not** a replacement for a teacher or parent; early-learner products should add safety, privacy, and pedagogy review.
|
| 65 |
+
- If you re-train on a different base (e.g. a larger chat model) and re-upload, update this card to match the new `config.json`.
|
| 66 |
+
|
| 67 |
+
## Citation
|
| 68 |
+
|
| 69 |
+
If you use this model, please cite the project repository and the Hugging Face model page. Example:
|
| 70 |
+
|
| 71 |
+
```bibtex
|
| 72 |
+
@misc{aimathtutor2026,
|
| 73 |
+
title = {AI Math Tutor for Early Learners},
|
| 74 |
+
author = {Addisu Seteye},
|
| 75 |
+
year = {2026},
|
| 76 |
+
howpublished = {\url{https://huggingface.co/AddisuSeteye/AI_Math_Tutor_for_Early_Learners}}
|
| 77 |
+
}
|
| 78 |
+
```
|
| 79 |
+
|
| 80 |
+
## Project context
|
| 81 |
+
|
| 82 |
+
This checkpoint is one deliverable of the **S2.T3.1** numeracy tutor work: instruction data in `data/T3.1_Math_Tutor/`, training script `tutor/llm_qlora.py` (see the GitHub repo for the full app, curriculum, and on-device tutor pipeline). The **Gradio child demo** in that repo does not load this merged checkpoint by default; the main product loop uses a separate pipeline (TTS, ASR, curriculum) described in the GitHub `README.md`.
|
| 83 |
+
|
| 84 |
+
---
|
| 85 |
+
|