Download unionmind/predictive_transfer/data.py from nur-dev/unionmind-predictive-representations: direct link, hf CLI and curl.
- Browser
- Download file 448 Bytes
-
https://huggingface.co/nur-dev/unionmind-predictive-representations/resolve/main/unionmind/predictive_transfer/data.py
- Command line
-
hf download hf://nur-dev/unionmind-predictive-representations/unionmind/predictive_transfer/data.py
-
curl -L -o data.py https://huggingface.co/nur-dev/unionmind-predictive-representations/resolve/main/unionmind/predictive_transfer/data.py
448 Bytes
| """Exact helper functions extracted from the frozen source adapter.""" | |
| import hashlib | |
| def digest_int(text):return int(hashlib.sha256(text.encode()).hexdigest(),16) | |
| def member(z,suffix): | |
| names=[n for n in z.namelist() if n.rsplit('/',1)[-1].lower()==suffix.lower()] | |
| assert names,(suffix,z.namelist()) | |
| # Provider robot archive contains both raw and nested zip copies; use raw. | |
| return z.read(sorted(names,key=lambda n:(len(n),n))[0]) | |