Spaces:
Running
Running
Download shared/utils/paths.py from bpiyush/SoundOfWater: direct link, hf CLI and curl.
- Browser
- Download file 1.23 kB
-
https://huggingface.co/spaces/bpiyush/SoundOfWater/resolve/main/shared/utils/paths.py
- Command line
-
hf download hf://spaces/bpiyush/SoundOfWater/shared/utils/paths.py
-
curl -L -o paths.py https://huggingface.co/spaces/bpiyush/SoundOfWater/resolve/main/shared/utils/paths.py
1.23 kB
| """Path utils.""" | |
| from os.path import dirname, abspath | |
| curr_filepath = abspath(__file__) | |
| repo_path = dirname(dirname(dirname(curr_filepath))) | |
| def get_data_root_from_hostname(): | |
| import socket | |
| data_root_lib = { | |
| "diva": "/ssd/pbagad/datasets/", | |
| "node": "/var/scratch/pbagad/datasets/", | |
| "fs4": "/var/scratch/pbagad/datasets/", | |
| "vggdev21": "/scratch/shared/beegfs/piyush/datasets/", | |
| "node407": "/var/scratch/pbagad/datasets/", | |
| "gnodee5": "/scratch/shared/beegfs/piyush/datasets/", | |
| "gnodeg2": "/scratch/shared/beegfs/piyush/datasets/", | |
| "gnodec2": "/scratch/shared/beegfs/piyush/datasets/", | |
| "Piyushs-MacBook-Pro": "/Users/piyush/projects/", | |
| "gnodec1": "/scratch/shared/beegfs/piyush/datasets/", | |
| "gnodec5": "/scratch/shared/beegfs/piyush/datasets/", | |
| "gnodec4": "/scratch/shared/beegfs/piyush/datasets/", | |
| "gnoded2": "/scratch/shared/beegfs/piyush/datasets/", | |
| } | |
| hostname = socket.gethostname() | |
| hostname = hostname.split(".")[0] | |
| assert hostname in data_root_lib.keys(), \ | |
| "Hostname {} not in data_root_lib".format(hostname) | |
| data_root = data_root_lib[hostname] | |
| return data_root | |