bigcode/the-stack-dedup
Viewer โข Updated โข 237M โข 19.2k โข 432
A GPT-style language model (127M parameters) trained from scratch on C source code (The Stack v1, dedup, C subset).
tiktoken), vocab padded to 50304model.safetensors (fp32) and model-fp16.safetensorspip install torch safetensors tiktoken huggingface_hub
from huggingface_hub import snapshot_download
import sys
path = snapshot_download("ALEXJMATHEW/Alx-1-125M-C")
sys.path.insert(0, path)
from alx_model import load_alx1, complete
model = load_alx1(path, device="cuda", weights="model-fp16.safetensors")
prompt = "#include <stdio.h>\n\n/* Return 1 if n is prime. */\nint is_prime(int n) {\n"
print(complete(model, prompt, device="cuda"))
This is a completion model, not an instruction follower: give it a comment, includes or a function signature and it continues.
This model saw far fewer tokens than a compute-optimal run for its size. Expect plausible-looking but often incorrect, incomplete or non-compiling C code. Training data comes from The Stack v1 (permissively licensed GitHub code); review the dataset terms and its opt-out policy before any commercial use.