File size: 1,493 Bytes
a330cfa | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 | ---
license: mit
tags:
- onnx
- smartwatch
- intent-classification
- text-generation
- wearable
library_name: onnxruntime
pipeline_tag: text-generation
---
# Smartwatch LM v0.2
Exported from [collab-run-2](../collab-run-2) training. Small GPT for wrist-wearable chat with intent tags like `<INTENT:GET_STEPS>`.
## Model details
| Property | Value |
|----------|-------|
| Architecture | 6-layer causal GPT (**~15.4M params**) |
| Context length | 256 tokens |
| Vocab size | 5533 (BPE) |
| Best val loss | 0.3243 |
| Training data | tinydata.txt, deepdata.txt, tinydata1.txt, data1.txt, data3.txt |
| Export version | 0.2 |
## Files
| File | Purpose |
|------|---------|
| `smartwatch_lm_merged.onnx` | On-device inference (ONNX Runtime, opset 17, ~0 MB) |
| `checkpoint.pt` | PyTorch weights |
| `tokenizer.json` | BPE tokenizer |
| `config.json` | Architecture + ONNX I/O |
| `model.py` / `chat.py` | PyTorch load + REPL |
| `reply_utils.py` | BPE cleanup, intent parse, slot fill |
| `onnx_sample.py` | ONNX generate sample |
## Quick start
```bash
pip install numpy onnxruntime tokenizers
python onnx_sample.py "How many steps today?"
```
```bash
pip install torch tokenizers
python chat.py
```
## ONNX I/O
- **Input:** `input_ids` int64 `[batch, seq]` (max seq = 256)
- **Output:** `logits` float `[batch, seq, vocab_size]`
See [Export-0.1 docs](docs/) for gibberish cleanup, intents, and device integration.
|