Spaces:
Sleeping
Sleeping
Hugging Face CLI Tool
This CLI tool allows you to upload and download models from Hugging Face repositories. It requires an Hugging Face Access Token (HF_TOKEN) for authentication, especially for private repositories.
Prerequisites
Install Hugging Face Hub:
pip install huggingface_hubGet HF_TOKEN:
- Log in to Hugging Face.
- Go to Settings → Access Tokens → Create a new token with
readandwritepermissions. - Save the token.
Usage
Set the Token:
- Linux/macOS:
export HF_TOKEN=your_token_here - Windows (CMD):
set HF_TOKEN=your_token_here
- Linux/macOS:
Download Model:
python main.py --download --repo-id <repo_name> --save-dir <local_save_path>Upload Model:
python main.py --upload --repo-id <repo_name> --model-path <local_model_path>
Example
To download a model:
python main.py
Authentication
Ensure you set HF_TOKEN to access private repositories. If not set, the script will raise an error.
Here’s a clearer and more polished version of that note:
⚠️ Note
Make sure to run this script from the HuggingFace directory to ensure correct path resolution and functionality.