"""Import the pinned upstream mini-AGI code with our own config.yaml. Upstream reads `config.yaml` from its repo root at call time (minagi.config.DEFAULT), including from inside the model (peek_experts reads training.chunk). Pointing DEFAULT at one of our configs makes every upstream call site see the scaled-down settings without editing upstream files. """ import os import sys ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) UPSTREAM = os.path.join(ROOT, "upstream", "mini-AGI") if UPSTREAM not in sys.path: sys.path.insert(0, UPSTREAM) import minagi.config as _mcfg # noqa: E402 def use_config(path): """Make every upstream config read resolve to `path`.""" path = os.path.abspath(path) if not os.path.exists(path): raise FileNotFoundError(path) _mcfg.DEFAULT = path return _mcfg.load(path)