PK9129/FineWeb
FineWebGPT
FineWebGPT is a GPT-2 small language model pretrained from scratch on 393,216,000 FineWeb-Edu tokens over 12,000 training steps. This Space presents the model with a polished dark layout, full model metadata, creator details, and an FP32 inference pipeline.
Model Summary
- Architecture: GPT-2 small
- Parameters: ~124M
- Training Type: From-scratch pretraining
- Dataset:
HuggingFaceFW/fineweb-edu/sample-10BT - Objective: causal language modeling
- Context Window: 1024 tokens
- Tokenizer: GPT-2 BPE
- Inference Precision: FP32
What Is Included
This project is prepared for direct Hugging Face Spaces hosting with:
app.py: Gradio Space app with the custom three-column layoutgpt2_inference.py: GPT-2 architecture, checkpoint loading, tokenizer loading, and generation enginespace_state.pt: smaller inference-only checkpointtrain_state.pt: original full training checkpointtokenizer_assets/gpt2/*: local GPT-2 tokenizer filesrequirements.txt
The app automatically prefers space_state.pt when it is present. If it is not present locally, the app can download it from a separate Hugging Face model repo by using MODEL_REPO_ID.
Creator Section
The Space already includes a creator card for Priyanshu Kumar and uses the local git email for contact. If you want to customize the public links further before uploading, edit the config block near the top of app.py or set these Space variables:
CREATOR_GITHUBCREATOR_LINKEDINCREATOR_PORTFOLIOCREATOR_HUGGINGFACECREATOR_EMAILCREATOR_BIOCREATOR_TITLE
Upload Notes
For the cleanest CPU Space upload:
- Create a new Gradio Space on Hugging Face.
- Put
space_state.ptin a separate model repo instead of the Space repo if your Space hits the 1 GB storage cap. - Upload only the Space app files and tokenizer assets to the Space repo.
- In the Space variables, set:
MODEL_REPO_ID=your-username/your-model-repoMODEL_FILENAME=space_state.pt- For a CPU Space, you do not need to set
MODEL_DEVICEat all. The app will run on CPU automatically. - If your model repo is private, add
HF_TOKENas a Space secret.
Local Launch
Frontend:
.\run_frontend_gpu.batCLI generation:
.\run_generate_gpu.bat --prompt "The future of artificial intelligence is"