Views
No views yet
model_09535.ptqa-sft_best.ptmodel_09535.pt)| Feature | Details |
|---|---|
| Parameters | 124M |
| Layers | 12 |
| Heads | 12 |
| Hidden size | 768 |
| Sequence length | 1024 |
| Vocab size | 50304 |
| Dataset | Ultra-FineWeb Edu (educational, high-quality web text) |
| Purpose | General language modeling |
qa-sft_best.pt)| Feature | Details |
|---|---|
| Base | The pretrained model above |
| Method | Supervised Fine-Tuning (SFT) |
| Dataset | Custom JSONL Q&A dataset |
| Domain | Australian facts, general knowledge, definitions, reasoning |
| Use-case | QA-style interactive chatbot |
{"instruction": "...", "response": "..."}tiktoken1git clone https://github.com/shubharthaksangharsha/karpathy
2cd karpathy/chapter-9-sft-rhlf-dpo-gpt2-124m1import torch
2from model import GPT
3
4ckpt = torch.load("model_09535.pt", map_location="cpu")
5model = GPT(config=ckpt['config'])
6model.load_state_dict(ckpt['model'])
7model.eval()
8
9out = model.generate("Who is the prime minister of australia?", max_new_tokens=60)
10print(out)1import torch
2from model import GPT
3
4ckpt = torch.load("qa-sft_best.pt", map_location="cpu")
5model = GPT(config=ckpt['config'])
6model.load_state_dict(ckpt['model'])
7model.eval()
8
9out = model.generate("What is the capital of Australia?", max_new_tokens=60)
10print(out)AutoModelForCausalLM.from_pretrained(...)1import torch
2state = torch.load("model_09535.pt", map_location="cpu")
3model = state["model"].from_pretrained() compatibility.1import torch
2from model import GPT
3from tokenizer import GPT2Tokenizer
4
5tokenizer = GPT2Tokenizer()
6
7ckpt = torch.load("qa-sft_best.pt")
8model = GPT(config=ckpt['config'])
9model.load_state_dict(ckpt['model'])
10model.eval()
11
12prompt = "Q: What is the capital of Australia?\nA:"
13tokens = tokenizer.encode(prompt)
14out = model.generate(tokens, max_new_tokens=60)
15print(tokenizer.decode(out))