Who it is forAn ML researcher who wants to reproduce or extend EBFM pretraining on a GPU machine and needs a working end-to-end run.
The problemSetting up energy-based language model pretraining from scratch involves dependencies, data preparation, and a training budget that must be set correctly.
The outcomeA pretraining run that writes checkpoints, a clean Hugging Face export, logs, and results under the standard outputs layout.
What you need first
- Python with uv installed
- A GPU environment (the README installs the gpu extra and loads checkpoints with device="cuda")
- Network access for data preparation and Hugging Face downloads
- Enough disk space for the datasets and checkpoints (sizes are not stated in the README)
Steps
- Run
uv sync --extra gpu --extra hf --extra webto install the GPU, Hugging Face, and web-chat dependencies. - Run
source .venv/bin/activateto activate the environment. - Run
bash runs/prepare_data.sh --datasets dclmon a machine with network access to download and tokenize DCLM. - Run
TARGET_TOTAL_TOKENS=100000000 bash runs/train.shto start pretraining with a 100M token budget. - Check
outputs/checkpoints_hf/for the exported model containing config.json and model.safetensors.
Prompt for your agent
Using the OpenEBFM repo (datamllab/OpenEBFM), prepare the dclm dataset and run pretraining with TARGET_TOTAL_TOKENS set to <token_budget> via runs/train.sh. Report the path of the final checkpoints_hf/ export and confirm it contains config.json and model.safetensors.
Caveat. Data preparation needs network access and training must run where the prepared data is available, and the README does not state hardware needs or run duration.
Use this in your AI agent
Ask your agent
Using the Deduped MCP, get the setup steps for datamllab/OpenEBFM and "Pretrain an EBFM model to a chosen token budget"
Add Deduped to Claude Code once
claude mcp add --transport http deduped https://dedupedai.com/mcp
Every Monday: the 5 hottest repos and exactly how to use them. Free, one email a week, unsubscribe anytime.
Get them freeShare: X LinkedIn Hacker News Email Copy link
Third-party repos we don't own. AI-written use cases can be wrong. Disclaimer