Skip to content

Hugging Face Model Registry Integration

Overview

IdeaWeaver integrates with Hugging Face for model hosting and versioning. This guide shows you how to use Hugging Face with IdeaWeaver for model management and deployment.

Setup

Train and Push a Model

source ideaweaver-env/bin/activate
ideaweaver train \
  --model sshleifer/tiny-distilbert-base-cased \
  --dataset ./datasets/training_data.csv \
  --push-to-hub \
  --hub-model-id <your-username>/<model-name> \
  --hub-token <your-huggingface-token>

Example Output

🤗 Using model: sshleifer/tiny-distilbert-base-cased
🚀 Starting model training...

============================================================
🎉 TRAINING SUMMARY
============================================================
📂 Model Path:           ./my-model
🤖 Base Model:           sshleifer/tiny-distilbert-base-cased
📊 Dataset:              ./autotrain_projects/my-model

📊 KEY PERFORMANCE METRICS
----------------------------------------
📉 Final Train Loss:     1.0986
🎯 Overall Accuracy:     20.0%

============================================================
✨ Training completed successfully! Model is ready for use.
============================================================

✅ Training completed successfully!
📁 Model saved to: ./my-model
🚀 Pushing model to Hugging Face Hub...
✅ Model pushed successfully to <your-username>/<model-name>

Hugging Face Hub Example

Once your model is pushed, you can view it on the Hugging Face Hub:

Hugging Face Hub Screenshot

Features

  • Model hosting
  • Version control
  • Model cards
  • Inference API
  • Community sharing
  • Model evaluation

Configuration

Required Parameters

  • --push-to-hub: Flag to enable pushing to Hugging Face Hub
  • --hub-model-id: Model ID in format username/model-name
  • --hub-token: Your Hugging Face API token

Getting Your Hugging Face Token

  1. Go to Hugging Face Settings
  2. Create a new token
  3. Copy the token value
  4. Use it in your training command

Best Practices

  1. Model Organization
  2. Use meaningful model names
  3. Add detailed model cards
  4. Document model versions

  5. Model Management

  6. Version your models
  7. Add model descriptions
  8. Track model lineage

  9. Community

  10. Share models appropriately
  11. Document usage
  12. Provide examples

Troubleshooting

Common Issues

  1. Authentication Errors
  2. Verify token is correct
  3. Check token permissions
  4. Ensure proper access

  5. Connection Issues

  6. Check internet connection
  7. Verify model ID format
  8. Validate repository exists

Debug Mode

Enable verbose output for debugging:

ideaweaver train \
  --model sshleifer/tiny-distilbert-base-cased \
  --dataset ./datasets/training_data.csv \
  --push-to-hub \
  --hub-model-id <your-username>/<model-name> \
  --verbose

Resources