recomendation / README_HF_SETUP.md
Ali Mohsin
Add Hugging Face setup documentation and security improvements
f1defd8
|
raw
history blame
1.54 kB

Hugging Face Setup Guide

πŸ” Setting Up Hugging Face Authentication

1. Get Your HF Token

2. Set Environment Variables

Option A: In Hugging Face Spaces (Recommended)

  1. Go to your Space settings
  2. Add these secrets:
    • HF_TOKEN: Your Hugging Face token
    • HF_USERNAME: Your Hugging Face username (e.g., "Stylique")

Option B: Local Development

export HF_TOKEN="hf_your_token_here"
export HF_USERNAME="your_username"

3. Verify Setup

source setup_hf.sh

πŸš€ What Happens Next

Once environment variables are set, the system will automatically:

  • βœ… Authenticate with Hugging Face
  • βœ… Upload trained models to {HF_USERNAME}/dressify-models
  • βœ… Upload datasets to {HF_USERNAME}/Dressify-Helper
  • βœ… Create repositories if they don't exist

πŸ”’ Security Notes

  • Never commit tokens to git
  • Use environment variables or HF Spaces secrets
  • Tokens are automatically masked in logs

πŸ“ Repository Structure

After successful upload:

{HF_USERNAME}/dressify-models/
β”œβ”€β”€ resnet_item_embedder_best.pth
β”œβ”€β”€ vit_outfit_model_best.pth
β”œβ”€β”€ resnet_metrics.json
└── vit_metrics.json

{HF_USERNAME}/Dressify-Helper/
β”œβ”€β”€ train.json
β”œβ”€β”€ valid.json
β”œβ”€β”€ test.json
β”œβ”€β”€ outfit_triplets_train.json
β”œβ”€β”€ outfit_triplets_valid.json
└── outfit_triplets_test.json