minicpm-video-analyzer / DEPLOYMENT_GUIDE.md
chakkale's picture
Upload 4 files
3bb1b87 verified
|
raw
history blame
2.69 kB

🚀 HF Spaces Deployment Guide

Quick Deployment Steps

1. Create Hugging Face Space

  1. Go to Hugging Face Spaces
  2. Click "Create new Space"
  3. Fill in the details:
    • Space name: minicpm-video-analyzer (or your choice)
    • License: Apache 2.0
    • SDK: Gradio
    • Hardware: GPU (T4 or better) - Required for MiniCPM-o
    • Visibility: Public or Private (your choice)

2. Upload Files

Upload these files to your space:

  • app.py - Main application
  • requirements.txt - Dependencies
  • README.md - Documentation

3. Configure Hardware (Important!)

With your HF Pro account:

  1. Go to your space settings
  2. Select "Hardware"
  3. Choose "T4 small" or better GPU
  4. Set timeout to 30+ minutes for processing

4. Deploy & Test

  1. Your space will automatically build (takes 5-10 minutes)
  2. First model load will download ~8GB (takes 5-10 minutes)
  3. Test with a short video (15-30 seconds)

Hardware Recommendations

GPU VRAM Performance Cost/hour
T4 16GB Good $0.60
A10G 24GB Better $3.15
A100 40GB Best $4.13

For testing: T4 is sufficient and cost-effective

Expected Performance

  • Model Loading: 5-10 minutes (first time only)
  • 30-second video: 5-15 minutes processing
  • Memory Usage: ~8-12GB VRAM
  • Processing: 1 frame per second analysis

Troubleshooting

Common Issues:

  1. Out of Memory:

    • Upgrade to larger GPU (A10G recommended)
    • Reduce video length/resolution
  2. Model Loading Fails:

    • Check internet connection
    • Restart the space
    • Ensure GPU is selected
  3. Slow Processing:

    • Normal for first run (model download)
    • Subsequent runs should be faster

Cost Optimization:

  • Development: Use CPU for testing UI (no model loading)
  • Production: Use T4 GPU for actual analysis
  • Pause: Turn off GPU when not in use

Comparison Testing

Once deployed, you can:

  1. Test same videos on both systems
  2. Compare analysis quality
  3. Measure processing times
  4. Evaluate cost differences

Next Steps

After successful deployment:

  1. Test with your existing video samples
  2. Compare results with your Node.js GPT-4o system
  3. Evaluate which approach works better for your use case
  4. Consider hybrid approach: use both systems for different scenarios

Support

If you encounter issues:

  • Check HF Spaces logs
  • Verify GPU allocation
  • Ensure all files are uploaded correctly
  • Test with smaller videos first