Spaces:
Build error
Build error
Download scripts/hf_utils.py from yeq6x/Image2Body_gradio: direct link, hf CLI and curl.
- Browser
- Download file 371 Bytes
-
https://huggingface.co/spaces/yeq6x/Image2Body_gradio/resolve/main/scripts/hf_utils.py
- Command line
-
hf download hf://spaces/yeq6x/Image2Body_gradio/scripts/hf_utils.py
-
curl -L -o hf_utils.py https://huggingface.co/spaces/yeq6x/Image2Body_gradio/resolve/main/scripts/hf_utils.py
371 Bytes
| import os | |
| from huggingface_hub import hf_hub_download | |
| def download_file(filename, subfolder=None): | |
| print(f'Downloading {filename} from Hugging Face Hub...') | |
| return hf_hub_download( | |
| repo_id=os.environ['REPO_ID'], | |
| filename=filename, | |
| subfolder=subfolder, | |
| token=os.environ['HF_TOKEN'], | |
| cache_dir=os.environ['CACHE_DIR'] | |
| ) | |