Skip to content

Commit eb068f0

Browse files
Fix ModuleNotFoundError: swarm_agents / kg_data at eval import time
Same class of bug as PR openai#1094: the CT2038 CPU smoke test runs `python records/.../train_gpt.py` from the repo root, so the submission directory is not on sys.path and the sibling swarm_agents.py / kg_data.py modules fail to import. Both files are already shipped in the submission folder; this patch prepends the script's own directory to sys.path so imports resolve regardless of eval-harness CWD. Verified: py_compile OK on Python 3.10.11, runtime import of both swarm_agents (VotingMesh, TrainingMetrics) and kg_data (KG_IMPORTANCE_B64) succeeds when executed from repo root. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
1 parent 30b555b commit eb068f0

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

  • records/track_non_record_16mb/2026-03-29_SwarmGuided_KGConditioned_Training

‎records/track_non_record_16mb/2026-03-29_SwarmGuided_KGConditioned_Training/train_gpt.py‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,11 @@
2525
from torch import Tensor, nn
2626
from torch.nn.parallel import DistributedDataParallel as DDP
2727
from flash_attn_interface import flash_attn_func as flash_attn_3_func
28+
# Make the submission self-contained regardless of eval-harness CWD: the
29+
# sibling swarm_agents.py and kg_data.py live next to this file but aren't
30+
# on sys.path when the harness runs `python records/.../train_gpt.py` from
31+
# the repo root.
32+
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
2833
from swarm_agents import VotingMesh, TrainingMetrics
2934

3035
# ---------------------------------------------------------------------------

0 commit comments

Comments
 (0)