Ali Mohsin commited on
Commit
f1defd8
Β·
1 Parent(s): 227af5e

Add Hugging Face setup documentation and security improvements

Browse files
Files changed (1) hide show
  1. README_HF_SETUP.md +60 -0
README_HF_SETUP.md ADDED
@@ -0,0 +1,60 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Hugging Face Setup Guide
2
+
3
+ ## πŸ” Setting Up Hugging Face Authentication
4
+
5
+ ### 1. Get Your HF Token
6
+ - Go to https://huggingface.co/settings/tokens
7
+ - Create a new token with **Write** permissions
8
+ - Copy the token (starts with `hf_...`)
9
+
10
+ ### 2. Set Environment Variables
11
+
12
+ #### Option A: In Hugging Face Spaces (Recommended)
13
+ 1. Go to your Space settings
14
+ 2. Add these secrets:
15
+ - `HF_TOKEN`: Your Hugging Face token
16
+ - `HF_USERNAME`: Your Hugging Face username (e.g., "Stylique")
17
+
18
+ #### Option B: Local Development
19
+ ```bash
20
+ export HF_TOKEN="hf_your_token_here"
21
+ export HF_USERNAME="your_username"
22
+ ```
23
+
24
+ ### 3. Verify Setup
25
+ ```bash
26
+ source setup_hf.sh
27
+ ```
28
+
29
+ ## πŸš€ What Happens Next
30
+
31
+ Once environment variables are set, the system will automatically:
32
+ - βœ… Authenticate with Hugging Face
33
+ - βœ… Upload trained models to `{HF_USERNAME}/dressify-models`
34
+ - βœ… Upload datasets to `{HF_USERNAME}/Dressify-Helper`
35
+ - βœ… Create repositories if they don't exist
36
+
37
+ ## πŸ”’ Security Notes
38
+
39
+ - **Never commit tokens to git**
40
+ - **Use environment variables or HF Spaces secrets**
41
+ - **Tokens are automatically masked in logs**
42
+
43
+ ## πŸ“ Repository Structure
44
+
45
+ After successful upload:
46
+ ```
47
+ {HF_USERNAME}/dressify-models/
48
+ β”œβ”€β”€ resnet_item_embedder_best.pth
49
+ β”œβ”€β”€ vit_outfit_model_best.pth
50
+ β”œβ”€β”€ resnet_metrics.json
51
+ └── vit_metrics.json
52
+
53
+ {HF_USERNAME}/Dressify-Helper/
54
+ β”œβ”€β”€ train.json
55
+ β”œβ”€β”€ valid.json
56
+ β”œβ”€β”€ test.json
57
+ β”œβ”€β”€ outfit_triplets_train.json
58
+ β”œβ”€β”€ outfit_triplets_valid.json
59
+ └── outfit_triplets_test.json
60
+ ```