{
 "schema_version": 1,
 "generated": "2026-10-20",
 "id": "datamllab-openebfm--pretrain-ebfm-at-token-budget",
 "repo": "datamllab/OpenEBFM",
 "repo_url": "https://github.com/datamllab/OpenEBFM",
 "repo_slug": "datamllab-openebfm",
 "title": "Pretrain an EBFM model to a chosen token budget",
 "page_title": "How to pretrain an EBFM model to a chosen token budget with Open EBFM",
 "summary": "Prepare DCLM data and run a full pretraining job with a set token count.",
 "who": "An ML researcher who wants to reproduce or extend EBFM pretraining on a GPU machine and needs a working end-to-end run.",
 "problem": "Setting up energy-based language model pretraining from scratch involves dependencies, data preparation, and a training budget that must be set correctly.",
 "outcome": "A pretraining run that writes checkpoints, a clean Hugging Face export, logs, and results under the standard outputs layout.",
 "steps": [
  "Run `uv sync --extra gpu --extra hf --extra web` to install the GPU, Hugging Face, and web-chat dependencies.",
  "Run `source .venv/bin/activate` to activate the environment.",
  "Run `bash runs/prepare_data.sh --datasets dclm` on a machine with network access to download and tokenize DCLM.",
  "Run `TARGET_TOTAL_TOKENS=100000000 bash runs/train.sh` to start pretraining with a 100M token budget.",
  "Check `outputs/checkpoints_hf/` for the exported model containing config.json and model.safetensors."
 ],
 "agent_prompt": "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.",
 "agents": [
  "any"
 ],
 "difficulty": "Advanced",
 "time": "3 hours",
 "basis": "readme",
 "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.",
 "category": "Research",
 "tags": [
  "Research"
 ],
 "lang": "python",
 "requirements": [
  "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)"
 ],
 "risk": "none",
 "seen_in_the_wild": false,
 "mentioned_publicly": false,
 "risks": [],
 "best": true,
 "score": 1.0,
 "evidence": [],
 "url": "https://dedupedai.com/use-cases/datamllab-openebfm/pretrain-ebfm-at-token-budget/",
 "md": "https://dedupedai.com/use-cases/datamllab-openebfm/pretrain-ebfm-at-token-budget/index.md",
 "disclaimer": "Deduped lists open-source repositories that belong to other people. We do not own, maintain, audit, or vouch for any of them, and a repo appearing here is not an endorsement or a safety check. The use cases, steps, and prompts are written by AI and may be incomplete, outdated, or just wrong. Where a use case is marked \"Seen in the wild\", we link to public posts where someone described something similar, but we have not verified those posts and the use case itself is still our AI's own write-up. Use all of this at your own risk. Only run code, commands, or agents on systems and accounts you are authorized to use, and read the code and every command before you run it, especially anything that touches credentials, files, or the network. Nothing here is professional, security, legal, or financial advice. All trademarks and project names belong to their respective owners, and their use here does not imply affiliation. Content is provided as is, without warranties of any kind. Found a mistake, a safety problem, or something you want removed? Email hello@dedupedai.com and we will look at it promptly.",
 "api": "https://dedupedai.com/api/v1/usecases/datamllab-openebfm--pretrain-ebfm-at-token-budget.json",
 "api_version": "v1"
}
