Spaces:
Build error
Build error
Download cache_model.py from crowd-index/count: direct link, hf CLI and curl.
- Browser
- Download file 231 Bytes
-
https://huggingface.co/spaces/crowd-index/count/resolve/main/cache_model.py
- Command line
-
hf download hf://spaces/crowd-index/count/cache_model.py
-
curl -L -o cache_model.py https://huggingface.co/spaces/crowd-index/count/resolve/main/cache_model.py
231 Bytes
| # cache_model.py | |
| import torch | |
| import torchvision.models as models | |
| torch.hub.set_dir('/app') | |
| def cache_model(): | |
| model = models.resnet152(pretrained=True) | |
| print("Model cached") | |
| if __name__ == "__main__": | |
| cache_model() | |