Downloads · 30 days
0
cgarciams/gsp2_355m_sft
gsp2_355m_sft is a text generation model from cgarciams. Use it when you need the model to write or continue text. It is set up for generic. The card lists the license as mit.
This repository hosts a custom-engineered, 355-million parameter GPT-2 style causal language model built completely from the ground up in PyTorch. The base model was pre-trained locally on OpenWebText, an open-source…
Downloads · 30 days
0
Access
Public
Updated Jul 4, 2026
Repo size
3.5 GB
Likes
1
Public
Click a slice to open those files.
.pth1.7 GB · 100%
From the Hugging Face model README
This repository hosts a custom-engineered, 355-million parameter GPT-2 style causal language model built completely from the ground up in PyTorch. The base model was pre-trained locally on OpenWebText, an open-source recreation of OpenAI's WebText dataset. This specific .pth file contains the Supervised Fine-Tuned (SFT) weights, aligned to accurately follow instructions and perform conversational tasks.
The project was built following the architectural principles outlined in Sebastian Raschka's "Build a Large Language Model (From Scratch)".
en)| Component | Specification |
|---|---|
| Layers | 24 |
| Attention Heads | 16 |
| Embedding Dimension | 1024 |
| Vocabulary Size | 50,257 (tiktoken GPT-2 BPE) |
| Query-Key-Value Bias | Disabled (False) |
The model's development cycle consisted of two major phases:
The underlying base model architecture was pre-trained completely from scratch on OpenWebText, an open-source replica of the Reddit-extracted outbound link text corpus originally utilized by OpenAI.
The model underwent Supervised Fine-Tuning utilizing the Alpaca dataset through 3 epochs.
Fine-tuning was executed locally using an optimized deep-learning workstation running a single NVIDIA GeForce RTX 5090.
AdamWBecause this model was compiled from native, custom PyTorch source code rather than the Hugging Face transformers library wrappers, you must load the saved .pth state dictionary directly back into your custom script definition matching the architecture settings:
import torch
from p02_gpt_model import GPTModel, GPT_CONFIG_355M
# 1. Initialize custom model configuration
model = GPTModel(GPT_CONFIG_355M)
# 2. Map the state dictionary weights
MODEL_PATH = "../models/gsp-2/gsp2_355m_sft.pth"
model_state_dict = torch.load(MODEL_PATH, map_location="cpu", weights_only=True)
model.load_state_dict(model_state_dict)
model.eval()