Views
No views yet
| Architecture | GPT-2 small (124M, custom from-scratch impl in GPT2.py) |
| Base model | OpenAI GPT-2 small (BPE vocab, 1024 ctx) |
| Fine-tuning data | ~4,440 instruction tuples (85% PMData-grounded, 15% MedQuAD general) |
| Training | PyTorch + tiktoken, AdamW lr 5e-5, 3 epochs |
| Final val loss | 0.66 |
| File | model_fitness_small.pth (PyTorch state dict, ~670 MB) |
| License (weights) | CC BY-NC 4.0 (inherits from PMData) |
Below is an instruction that describes a task. Write a response that appropriately completes the request.
### Instruction:
Should I do a hard workout today?
### Input:
Sleep: 7h 31m total (deep 2h 23m, REM 1h 54m, score 88/100)
Resting HR: 55 bpm (-1.9 vs 7-day baseline)
Activity: 58 very-active min
Subjective: fatigue 2/5, stress 4/5, soreness 3/5, mood 3/5, sleep quality 4/5, readiness 3/10
### Response:resting_hr_baseline_delta_bpm as a proxy and not to fabricate HRV values1import torch, tiktoken
2from huggingface_hub import hf_hub_download
3import sys; sys.path.append("path/to/fitness-gpt2-agent")
4from GPT2 import GPTModel
5from util import generate
6
7BASE_CONFIG = {
8 "vocab_size": 50257, "context_length": 1024, "drop_rate": 0.0,
9 "qkv_bias": True, "emb_dim": 768, "n_layers": 12, "n_heads": 12,
10}
11device = "mps" if torch.backends.mps.is_available() else "cpu"
12
13ckpt_path = hf_hub_download(repo_id="MS846/fitness-gpt2-124m",
14 filename="model_fitness_small.pth")
15
16model = GPTModel(BASE_CONFIG)
17model.load_state_dict(torch.load(ckpt_path, map_location=device, weights_only=True))
18model.to(device).eval()
19
20tokenizer = tiktoken.get_encoding("gpt2")
21prompt = "..." # Alpaca-style as shown above
22ids = torch.tensor(tokenizer.encode(prompt)).unsqueeze(0).to(device)
23out_ids = generate(model=model, idx=ids, max_new_tokens=200,
24 context_size=1024, eos_id=50256, top_k=50, temperature=0.7)
25print(tokenizer.decode(out_ids[0].tolist())[len(prompt):])fitness_app/01_model_export/convert_to_gguf.sh).1@misc{sharma2026fitnessagent,
2 author = {Sharma, Mayank},
3 title = {Fitness Agent: A Fine-tuned GPT-2 124M for On-Device Wearable Data Interpretation},
4 year = {2026},
5 url = {https://github.com/mak846/fitness-gpt2-agent}
6}