my-gradio-momask / debug_app.md
nocapdev's picture
Upload folder using huggingface_hub
4411958 verified
# Debugging Slow Response on Hugging Face Spaces
## How to Check Logs
1. Go to your Space: https://huggingface.co/spaces/nocapdev/my-gradio-momask
2. Click the **"Logs"** tab at the top
3. Look for errors or warnings
## Common Issues & What to Look For
### Issue 1: Models Not Loading
**Look for in logs:**
```
FileNotFoundError: [Errno 2] No such file or directory: './checkpoints/...'
```
**Cause:** Model checkpoints aren't uploaded to HF Spaces
### Issue 2: CUDA Not Available
**Look for in logs:**
```
RuntimeError: CUDA not available
```
**Cause:** HF free tier uses CPU, not GPU
### Issue 3: Out of Memory
**Look for in logs:**
```
torch.cuda.OutOfMemoryError
SIGKILL (killed by system)
```
**Cause:** Model too large for available RAM/VRAM
### Issue 4: Stuck on Generation
**Look for in logs:**
```
[Last line shows generation started but never completes]
```
**Cause:** Slow CPU inference or infinite loop
---
## Quick Fixes
### Fix 1: Check if it's using CPU instead of GPU
The app defaults to CUDA but HF Spaces free tier only has CPU.
**Action:** Tell me what you see in the logs, and I'll help optimize for CPU or upgrade to GPU Space.
### Fix 2: Models might be missing
**Check logs for:** "FileNotFoundError" or "checkpoint not found"
**If missing:** Models aren't uploaded. You need to either:
1. Upload models to HF Space (if <5GB)
2. Host models on HF Model Hub and download on startup
3. Use Spaces Secrets for large files
---
## What to Share
Copy from HF Spaces Logs tab and share:
1. **Startup logs** (first 20 lines)
2. **Error messages** (any red text)
3. **Last 10 lines** of logs when you submitted the prompt
This will help me identify the exact issue!