Datasets:
Formats:
csv
Languages:
English
Size:
< 1K
Tags:
continual-learning
catastrophic-forgetting
functional-memory
orthogonal-projection
statistical-certification
pytorch
Download tools/extract_research.py from PureOne/Eidrion: direct link, hf CLI and curl.
- Browser
- Download file 1.62 kB
-
https://huggingface.co/datasets/PureOne/Eidrion/resolve/main/tools/extract_research.py
- Command line
-
hf download hf://datasets/PureOne/Eidrion/tools/extract_research.py
-
curl -L -o extract_research.py https://huggingface.co/datasets/PureOne/Eidrion/resolve/main/tools/extract_research.py
1.62 kB
| #!/usr/bin/env python3 | |
| """Extract the unchanged original main research archive into a fresh folder.""" | |
| from __future__ import annotations | |
| import argparse | |
| from pathlib import Path, PurePosixPath | |
| import stat | |
| import sys | |
| import zipfile | |
| from verify_release import verify | |
| def main(): | |
| root = Path(__file__).resolve().parents[1] | |
| parser = argparse.ArgumentParser(description=__doc__) | |
| parser.add_argument('--output', type=Path, default=root / 'work') | |
| args = parser.parse_args() | |
| try: | |
| verify(root) | |
| output = args.output.resolve() | |
| if output.exists(): | |
| raise ValueError('Output must be a fresh, nonexistent directory') | |
| archive = root / 'archives/Eidrion_v1.0.0_Research_Package.zip' | |
| with zipfile.ZipFile(archive) as z: | |
| for item in z.infolist(): | |
| p = PurePosixPath(item.filename) | |
| if (p.is_absolute() or '..' in p.parts or '\\' in item.filename or ':' in item.filename | |
| or not p.parts or p.parts[0] != 'Eidrion_v1.0.0' | |
| or stat.S_ISLNK(item.external_attr >> 16)): | |
| raise ValueError(f'Unsafe archive member: {item.filename}') | |
| output.mkdir(parents=True) | |
| z.extractall(output) | |
| print(f'Extracted main research package: {output / "Eidrion_v1.0.0"}') | |
| print('The four large raw-evidence companions are not included.') | |
| return 0 | |
| except (OSError, ValueError, zipfile.BadZipFile) as exc: | |
| print(f'Extraction failed: {exc}', file=sys.stderr) | |
| return 1 | |
| if __name__ == '__main__': | |
| sys.exit(main()) | |