π¦ ClawHub
Huggingface Hub
by @noesis-boss
Access Hugging Face Hub models, datasets, and spaces via the huggingface_hub Python library. Use when you need to list, search, download, or upload HF assets.
π‘ Examples
# Search for text-to-image models
python3 .../hf_hub.py list-models --search "text-to-image" --limit 10Download a model file
python3 .../hf_hub.py download-file --repo-id "stabilityai/stable-diffusion-xl-base-1.0" --filename "pytorch_model.bin"Upload a file
python3 .../hf_hub.py upload-file --local-path ./model.pt --repo-id "your-username/my-model" --repo-type "model"List top-rated datasets
python3 .../hf_hub.py list-datasets --sort "likes" --direction desc --limit 5
βοΈ Configuration
Install the library:
pip install huggingface_hub
Save your HF token to Settings > Advanced as HF_TOKEN (get one at https://huggingface.co/settings/tokens).
π Tips & Best Practices
~/.cache/huggingface/repo-type values: model, dataset, spacemainTERMINAL
clawhub install hf-hub