Downloads · 30 days
5
19% of all-time downloads
Elriggs/gpt2-debug-baseline
gpt2-debug-baseline is a machine learning model from Elriggs. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
This is a GPT-2 style model trained with modifications from modded-nanogpt.
Downloads · 30 days
5
19% of all-time downloads
All-time downloads
26
Public
Repo size
19.7 MB
Likes
0
Public
Click a slice to open those files.
.bin19.7 MB · 100%
From the Hugging Face model README
This is a GPT-2 style model trained with modifications from modded-nanogpt.
from huggingface_hub import hf_hub_download
import torch
from train_gpt2 import GPT, GPTConfig
import json
# Download config
config_path = hf_hub_download(repo_id="Elriggs/gpt2-debug-baseline", filename="config.json")
with open(config_path) as f:
config_dict = json.load(f)
# Remove non-GPTConfig fields
config_dict.pop('step', None)
# Create model
config = GPTConfig(**config_dict)
model = GPT(config)
# Download and load weights
weights_path = hf_hub_download(repo_id="Elriggs/gpt2-debug-baseline", filename="pytorch_model.bin")
state_dict = torch.load(weights_path, map_location='cpu')
model.load_state_dict(state_dict)
model.eval()