Skip to content

A comprehensive toolkit for managing your Hugging Face Hub resources

License

Notifications You must be signed in to change notification settings

sumukshashidhar/hf-hub-utils

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🤗 Hugging Face Hub Utilities

Python Version License: MIT Code style: black

A comprehensive toolkit for managing your Hugging Face Hub resources


🌟 Features

  • 🔄 Organization Management
    • Move repositories between organizations
    • Batch operations support
    • Exception handling for specific repos
  • 🔒 Privacy Controls
    • Automatic repository privacy management
    • Secure token handling
  • 📊 Detailed Reporting
    • Operation summaries
    • Success rate tracking
    • Debug logging support

📦 Installation

# From source
git clone https://github.com/sumukshashidhar/hf-hub-utils.git
cd hf-hub-utils
pip install .

# Using pip (coming soon)
pip install hf-hub-utils

🛠️ Available Tools

Organization Mover

Move datasets and models between Hugging Face organizations with ease.

# Basic usage
hf-hub-utils org-mover --source source-org --target target-org

# With custom token
hf-hub-utils org-mover --source source-org --target target-org --token your-token

# Exclude specific repositories
hf-hub-utils org-mover --source source-org --target target-org --exceptions exceptions.txt

# Enable detailed logging
hf-hub-utils org-mover --source source-org --target target-org --debug

Excluding Repositories

Create an exceptions.txt file to specify repositories to skip:

# exceptions.txt
# One repository name per line (without organization prefix)
my-dataset-1
my-model-2

Features

  • ✨ Automatic repository privacy management
  • 🔄 Smart conflict resolution with timestamps
  • 📝 Detailed logging with progress tracking
  • ⚡ Efficient batch operations
  • 🎯 Selective migration with exceptions

🔧 Configuration

Environment Variables

Variable Description Required Used By
HF_TOKEN Hugging Face API token No (can use --token) org-mover

🤝 Contributing

We welcome contributions! Here's how you can help:

  1. 🍴 Fork the repository
  2. 🌿 Create a feature branch (git checkout -b feature/amazing-feature)
  3. 💻 Make your changes
  4. ✅ Run tests and linting
  5. 📝 Update documentation if needed
  6. 🔄 Push your changes (git push origin feature/amazing-feature)
  7. 🎯 Open a Pull Request

Development Setup

# Clone the repository
git clone https://github.com/sumukshashidhar/hf-hub-utils.git
cd hf-hub-utils

# Create a virtual environment
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate

# Install development dependencies
pip install -e ".[dev]"

Project Structure

hf_hub_utils/
├── common/           # Shared utilities
│   ├── logging.py   # Logging configuration
│   └── ...
├── org_mover/       # Organization mover tool
│   ├── cli.py       # Command-line interface
│   ├── mover.py     # Core functionality
│   └── ...
└── cli.py           # Main CLI entry point

📜 License

This project is licensed under the MIT License - see the LICENSE file for details.

🙏 Acknowledgments

  • Hugging Face for their amazing platform and APIs
  • All our contributors and users

Made with ❤️ by the community

About

A comprehensive toolkit for managing your Hugging Face Hub resources

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages