CoolFace
Apppublic

PK9129/FineWeb

sourceHugging Faceupdated 6mo agoView on Hugging Face
0likes
App README

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 layout
  • gpt2_inference.py: GPT-2 architecture, checkpoint loading, tokenizer loading, and generation engine
  • space_state.pt: smaller inference-only checkpoint
  • train_state.pt: original full training checkpoint
  • tokenizer_assets/gpt2/*: local GPT-2 tokenizer files
  • requirements.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_GITHUB
  • CREATOR_LINKEDIN
  • CREATOR_PORTFOLIO
  • CREATOR_HUGGINGFACE
  • CREATOR_EMAIL
  • CREATOR_BIO
  • CREATOR_TITLE

Upload Notes

For the cleanest CPU Space upload:

  1. 1.Create a new Gradio Space on Hugging Face.
  2. 2.Put space_state.pt in a separate model repo instead of the Space repo if your Space hits the 1 GB storage cap.
  3. 3.Upload only the Space app files and tokenizer assets to the Space repo.
  4. 4.In the Space variables, set:
  5. 5.MODEL_REPO_ID=your-username/your-model-repo
  6. 6.MODEL_FILENAME=space_state.pt
  7. 7.For a CPU Space, you do not need to set MODEL_DEVICE at all. The app will run on CPU automatically.
  8. 8.If your model repo is private, add HF_TOKEN as a Space secret.

Local Launch

Frontend:

powershell
.\run_frontend_gpu.bat

CLI generation:

powershell
.\run_generate_gpu.bat --prompt "The future of artificial intelligence is"