Views
No views yet
transformers model
classes. The repo includes the original PyTorch code so you can run, fine-tune,
or continue pretraining from these weights.pretrain.pt - base language model checkpoint (after WikiText-103 pretraining)summarizer.pt - SFT checkpoint for news summarization (start from this for inference)tokenizer.json - byte-level BPE tokenizer (32k vocab, specials: <pad> <bos> <eos> <unk>)meta.json - dataset metadata (vocab size, dtype, token counts)code/model.py - GPT model definitioncode/tokenizer.py - tokenizer wrapper with ByteLevel decoder fixcode/ask.py - inference script with repetition penalty, top-p, no-repeat-ngramcode/train.py - pretraining scriptcode/finetune_sft.py - supervised fine-tuning scriptcode/make_cnndm_sft.py - CNN/DailyMail SFT data buildercode/prepare_wikitext.py - WikiText-103 tokenization + tokenizer trainingn_layer = 12
n_head = 12
n_embd = 768
block_size = 512
vocab_size = 32000
parameters = 109.92M| Stage | Dataset | Steps | Final val loss |
|---|---|---|---|
| Pretrain | WikiText-103 | 12,000 | 3.15 |
| SFT (summarizer) | CNN/DailyMail | 6,000 | 2.97 |
1# Clone this repo
2git lfs install
3git clone https://huggingface.co/endurasolution/RON-110M
4cd RON-110M
5
6# Install minimal deps
7pip install torch numpy tokenizers rich
8
9# Run inference
10python code/ask.py \
11 --checkpoint summarizer.pt \
12 --tokenizer tokenizer.json \
13 --text "A man has been arrested in Manchester after a series of break-ins at local shops. Police said the suspect was found with stolen goods. He is due to appear in court on Monday." \
14 --max_new_tokens 80 \
15 --temperature 0.4 \
16 --top_p 0.9 \
17 --repetition_penalty 1.1 \
18 --no_repeat_ngram_size 3pretrain.pt:1python code/train.py \
2 --resume pretrain.pt \
3 --reset_step --reset_optimizer \
4 --data_dir data/wikitext103 \
5 --out_dir runs/wikitext-gpt \
6 --preset rtx3090_8h \
7 --batch_size 16 --grad_accum 8 \
8 --max_steps 12000 \
9 --learning_rate 2e-4 --min_lr 2e-5 \
10 --warmup_steps 200 \
11 --no_gradient_checkpointing \
12 --save_optimizerprompt and answer
keys, then:1python code/finetune_sft.py \
2 --base_checkpoint pretrain.pt \
3 --tokenizer tokenizer.json \
4 --sft_file your_data.jsonl \
5 --out_dir runs/my-finetune \
6 --max_steps 6000 \
7 --batch_size 8 --grad_accum 8 \
8 --learning_rate 5e-5 --min_lr 5e-6 \
9 --warmup_steps 200tokenizer.json. Do not substitute a GPT-2 tokenizer.transformers.AutoModel. Use the included code/.