Download scripts/capture_entry_pilot.py from psiloceyeben/oracle7-chameleon: direct link, hf CLI and curl.
- Browser
- Download file 1.23 kB
-
https://huggingface.co/psiloceyeben/oracle7-chameleon/resolve/main/scripts/capture_entry_pilot.py
- Command line
-
hf download hf://psiloceyeben/oracle7-chameleon/scripts/capture_entry_pilot.py
-
curl -L -o capture_entry_pilot.py https://huggingface.co/psiloceyeben/oracle7-chameleon/resolve/main/scripts/capture_entry_pilot.py
1.23 kB
| """Local bounded static-entry subset pilot, no execution or database admission.""" | |
| import argparse | |
| import json | |
| import sys | |
| from pathlib import Path | |
| ROOT = Path(__file__).resolve().parents[1] | |
| sys.path.insert(0, str(ROOT / "packages/core")) | |
| from chameleon_core.entry_capture import capture_entry | |
| if __name__ == "__main__": | |
| parser = argparse.ArgumentParser() | |
| parser.add_argument("source") | |
| parser.add_argument("entry") | |
| parser.add_argument("output") | |
| parser.add_argument("--additional-path", action="append", default=[]) | |
| args = parser.parse_args() | |
| output = Path(args.output).resolve() | |
| if not output.is_relative_to(ROOT / ".local/repository-pilot") or output.exists(): | |
| raise SystemExit("Fresh path inside repository pilot required") | |
| result = capture_entry(args.source, args.entry, additional_paths=args.additional_path) | |
| with output.open("x", encoding="utf-8") as stream: | |
| json.dump(result, stream) | |
| print( | |
| json.dumps( | |
| { | |
| "output": str(output), | |
| "digest": result["digest"], | |
| "files": len(result["repository"]["files"]), | |
| "projection": result["repository"]["projection"], | |
| } | |
| ) | |
| ) | |