Skip to content
Search

HuggingFace:Hub

lastmod 2024-05-08created 2024-05-081 edits

Download checkpoints

Install the package:

pip install huggingface_hub

Then download:

from huggingface_hub import hf_hub_download

chkpt_path = hf_hub_download("ybelkada/segment-anything", "checkpoints/sam_vit_b_01ec64.pth")

If the file already exists, it is not downloaded again. The checkpoint file path is returned as a string in the chkpt_path variable.

See also

author Zer0 sitemap