Download tasks/adsorption_laboratory/solution/reference/build.py from Tokenwave-AI/REE: direct link, hf CLI and curl.
- Browser
- Download file 1.05 kB
-
https://huggingface.co/datasets/Tokenwave-AI/REE/resolve/main/tasks/adsorption_laboratory/solution/reference/build.py
- Command line
-
hf download hf://datasets/Tokenwave-AI/REE/tasks/adsorption_laboratory/solution/reference/build.py
-
curl -L -o build.py https://huggingface.co/datasets/Tokenwave-AI/REE/resolve/main/tasks/adsorption_laboratory/solution/reference/build.py
1.05 kB
| """Install the vendored pure/Python-3.12 Linux wheels without pip or network.""" | |
| from pathlib import Path | |
| import hashlib | |
| import json | |
| import sys | |
| import zipfile | |
| here = Path(__file__).resolve().parent | |
| target = here/'vendor/site-packages' | |
| target.mkdir(parents=True, exist_ok=True) | |
| manifest = json.loads((here/'vendor/wheel_sha256.json').read_text()) | |
| for name, expected in sorted(manifest.items()): | |
| wheel = here/name | |
| if hashlib.sha256(wheel.read_bytes()).hexdigest() != expected: | |
| raise RuntimeError(f'Vendored wheel checksum mismatch: {wheel.name}') | |
| with zipfile.ZipFile(wheel) as archive: | |
| archive.extractall(target) | |
| sys.path.insert(0, str(target)) | |
| import numpy as np | |
| from descriptors import describe | |
| # Compile/cache the same descriptor kernel used at runtime, without labels. | |
| result = describe({'basis': [[4,0,0],[0,4,0],[0,0,4]], | |
| 'points': [[0.25,0.25,0.25]], 'kinds': ['t04']}) | |
| assert result.shape == (273,) | |
| assert np.isfinite(result).all(), 'Descriptor warmup must not silently impute a build failure.' | |