Add inference script + merge script + README section: run without downloading GPT-2 blocks each time

#2
by summerMC - opened

This adds two ready-to-run scripts plus a README section:

  1. inference_no_gpt2_blocks.py β€” generates text using only GPT-2's
    embeddings / final LayerNorm / LM head, never calling GPT-2's own
    12 transformer blocks (gpt2.transformer.h). All layer computation
    comes from this repo's trained SharedLayerReconstructor.

  2. merge_gpt2_into_homegpt.py β€” goes one step further and bakes GPT-2's
    embeddings / final LayerNorm / LM head weights directly into a new
    self-contained checkpoint alongside the reconstructor, saved to
    ./homeGPT-merged. After the first run, no separate GPT-2 download or
    trust_remote_code prompt is needed to generate text.

Changes:

  • Add inference_no_gpt2_blocks.py
  • Add merge_gpt2_into_homegpt.py
  • Append two sections to README.md documenting both scripts

Usage:
python inference_no_gpt2_blocks.py --prompt "Your prompt here"
python merge_gpt2_into_homegpt.py --prompt "Your prompt here"

summerMC changed pull request status to merged

Sign up or log in to comment