Skip to content

Downloading CoAtNet offline #1950

Answered by hankyul2
emanalattas asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @emanalattas

As the Google Colab seems to prohibit browsing specific folders such as root (maybe I'm wrong), you can alternatively save the model weight to your /home/ folder and access it through the file browser.

You can download model weight to a specific folder e.g., /home/ by setting the local_dir parameter in hf_hub_download(..., local_dir='/home/') like the below code snippet.

import timm
from huggingface_hub import hf_hub_download
import torch

saved_path = hf_hub_download('timm/coatnet_rmlp_2_rw_224.sw_in12k_ft_in1k', 'pytorch_model.bin', local_dir='/home/', library_name='timm', library_version=timm.__version__)
state_dict = torch.load(saved_path, map_location='cpu')

I hope th…

Replies: 4 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@emanalattas
Comment options

Answer selected by emanalattas
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants