Spaces:
Runtime error
Runtime error
Download lib/utils/data/io.py from IsshikiHugh/HSMR: direct link, hf CLI and curl.
- Browser
- Download file 289 Bytes
-
https://huggingface.co/spaces/IsshikiHugh/HSMR/resolve/main/lib/utils/data/io.py
- Command line
-
hf download hf://spaces/IsshikiHugh/HSMR/lib/utils/data/io.py
-
curl -L -o io.py https://huggingface.co/spaces/IsshikiHugh/HSMR/resolve/main/lib/utils/data/io.py
289 Bytes
| import pickle | |
| from pathlib import Path | |
| def load_pickle(fn, mode='rb', encoding=None, pickle_encoding='ASCII'): | |
| if isinstance(fn, Path): | |
| fn = str(fn) | |
| with open(fn, mode=mode, encoding=encoding) as f: | |
| data = pickle.load(f, encoding=pickle_encoding) | |
| return data |