Download code/harness/upstream.py from dreddnafious/mini-agi-replication: direct link, hf CLI and curl.
- Browser
- Download file 854 Bytes
-
https://huggingface.co/spaces/dreddnafious/mini-agi-replication/resolve/main/code/harness/upstream.py
- Command line
-
hf download hf://spaces/dreddnafious/mini-agi-replication/code/harness/upstream.py
-
curl -L -o upstream.py https://huggingface.co/spaces/dreddnafious/mini-agi-replication/resolve/main/code/harness/upstream.py
854 Bytes
| """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) | |