Skip to content

Instantly share code, notes, and snippets.

@akaanirban
Created September 26, 2023 03:40
Show Gist options
  • Save akaanirban/ca9a7a194fa8e81d62ce2ad67cebfa95 to your computer and use it in GitHub Desktop.
Save akaanirban/ca9a7a194fa8e81d62ce2ad67cebfa95 to your computer and use it in GitHub Desktop.
Download Models from Huggingface to a local directory and exclude `*.bin` files

Run the following code to download model to a. local directory from huggingface and exclude *.bin files:

import huggingface_hub

huggingface_hub.snapshot_download(repo_id="meta-llama/Llama-2-7b-chat-hf", local_dir="./meta-llama_Llama-2-7b-chat-hf", local_dir_use_symlinks=False, resume_download=True, ignore_patterns=["*.msgpack", "*.h5", "*.bin"])
print("done")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment