Created
May 23, 2025 17:26
-
-
Save vadimkantorov/8d1f8881c462002bcafb2591cdae786a to your computer and use it in GitHub Desktop.
Downloads and tests import of a HuggingFace model into a meta device (and thus does not use any GPU/CPU memory)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Usage: bash cache_hf_model.sh Qwen/Qwen3-8B | |
# export HF_HOME=/my/cache/HF_HOME | |
python -c 'import sys, transformers; transformers.AutoModel.from_pretrained(sys.argv[-1], trust_remote_code=True, device_map="meta")' $@ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment