Spaces:
Sleeping
Sleeping
File size: 3,082 Bytes
42a331b |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 |
# Setting Up Model Hub for Checkpoints
## Step-by-Step Guide
### Step 1: Create Model Hub Repository
1. **Go to**: https://huggingface.co/new
2. **Select**: "Model" (not Space or Dataset)
3. **Fill in**:
- **Repository name**: `starflow-3b-checkpoint`
- **Owner**: `GlobalStudio` (or your username)
- **Visibility**: Private (recommended) or Public
4. **Click**: "Create repository"
### Step 2: Upload Checkpoint to Model Hub
1. **Go to your Model repository**:
https://huggingface.co/GlobalStudio/starflow-3b-checkpoint
2. **Click**: "Files" tab
3. **Click**: "Add file" β "Upload files"
4. **Upload**: `starflow_3B_t2i_256x256.pth` (14GB)
- Drag and drop or browse
- Wait for upload (30-60 minutes)
- β
No storage limit issues in Model Hub!
### Step 3: Update app.py (Already Done!)
The app is already configured! Just make sure the repo ID matches:
```python
IMAGE_CHECKPOINT_REPO = "GlobalStudio/starflow-3b-checkpoint"
```
If your repo name is different, update this line in `app.py`.
### Step 4: Test Your Space
1. **Go to your Space**: https://huggingface.co/spaces/GlobalStudio/starflow
2. **Wait for rebuild** (if app.py was updated)
3. **Open the Gradio interface**
4. **Enter a prompt** (no need to upload checkpoint!)
5. **Click "Generate Image"**
6. **First time**: Will download checkpoint (one-time, ~5-10 minutes)
7. **After that**: Uses cached checkpoint (fast!)
## How It Works
1. **First Request**:
- App checks for local checkpoint β Not found
- Downloads from Model Hub β `/tmp/checkpoints/`
- Caches it for future use
2. **Subsequent Requests**:
- Uses cached checkpoint β Fast!
- No download needed
3. **Cache Location**: `/tmp/checkpoints/` (persists in Space)
## Benefits
β
**No storage limit** - Model Hub designed for large files
β
**Free** - No cost for Model Hub storage
β
**Automatic caching** - Downloads once, uses forever
β
**Version control** - Can update checkpoints easily
β
**Shareable** - Can use across multiple Spaces
## Troubleshooting
### Issue: "Repository not found"
- **Solution**: Make sure repo ID matches exactly: `"username/repo-name"`
- Check: https://huggingface.co/GlobalStudio/starflow-3b-checkpoint exists
### Issue: "Download failed"
- **Solution**: Check internet connection, repo visibility (private repos need auth)
- For private repos, set HF_TOKEN in Space settings
### Issue: "Checkpoint not found"
- **Solution**: Verify filename matches exactly: `starflow_3B_t2i_256x256.pth`
- Check Model Hub Files tab to confirm filename
## For Video Model (Optional)
If you also have the video checkpoint:
1. **Create another Model repo**: `starflow-v-7b-checkpoint`
2. **Upload**: `starflow-v_7B_t2v_caus_480p_v3.pth`
3. **Update app.py**:
```python
VIDEO_CHECKPOINT_REPO = "GlobalStudio/starflow-v-7b-checkpoint"
```
## Summary
1. β
Create Model Hub repo
2. β
Upload checkpoint (14GB, no limit!)
3. β
App already configured
4. β
Test and enjoy!
The app will automatically download and cache the checkpoint on first use! π
|