nanoWeatherGPT
A character-level GPT (~813K parameters) trained from scratch on synthetic weather forecast text.
Download & Use
from huggingface_hub import snapshot_download
import torch, pickle, sys
# Download all files
path = snapshot_download("agoel7029/nano-weather-gpt-model")
sys.path.insert(0, path)
from model import GPT
ckpt = torch.load(f"{path}/model.pt", map_location="cpu", weights_only=False)
meta = pickle.load(open(f"{path}/meta.pkl", "rb"))
stoi, itos = meta["stoi"], meta["itos"]
model = GPT(ckpt["config"])
model.load_state_dict(ckpt["model_state_dict"])
model.eval()
prompt = "Today the weather is"
ctx = torch.tensor([[stoi[c] for c in prompt]], dtype=torch.long)
with torch.no_grad():
out = model.generate(ctx, max_new_tokens=200)
print("".join(itos[i] for i in out[0].tolist()))
Fine-tune on your own data
Edit train.py — replace generate_weather_corpus() with your own text, then run:
python train.py
Model details
| Property | Value |
|---|---|
| Architecture | Character-level GPT (Transformer) |
| Parameters | ~813K |
| Layers | 4 |
| Attention heads | 4 |
| Embedding dim | 128 |
| Context length | 128 characters |
| Trained on | Synthetic Swiss city weather reports |
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support