conduct-regulation / TROUBLESHOOTING.md
Sangmin's picture
Add font support and documentation files
d4079fb

A newer version of the Gradio SDK is available: 5.49.1

Upgrade

🔧 Troubleshooting Guide for Hugging Face Deployment

Error: "TypeError: argument of type 'bool' is not iterable"

Solution Applied:

  1. Downgraded Gradio to stable version 4.19.2
  2. Fixed launch configuration for HF Spaces
  3. Created simplified version (app_simple.py) as fallback

To Apply Fixes:

Option 1: Update Existing Space

cd /Users/sangmin/Developer/Qwen2.5-VL/huggingface-space
./update_space.sh

Option 2: Manual Update via Web

  1. Go to your Space: https://huggingface.co/spaces/YOUR_USERNAME/YOUR_SPACE
  2. Click "Files" tab
  3. Edit requirements.txt:
    gradio==4.19.2
    Pillow>=10.0.0
    openai>=1.0.0
    
  4. Edit app.py - change last line to:
    demo.queue(max_size=20).launch(server_name="0.0.0.0", server_port=7860)
    
  5. Commit changes

Option 3: Use Simplified Version

If main app still has issues:

  1. Upload app_simple.py to your Space
  2. Go to Space Settings
  3. Change app_file from app.py to app_simple.py
  4. Save changes

Other Common Issues

1. Build Fails

  • Check logs in "Logs" tab
  • Verify requirements.txt syntax
  • Try simplified app version

2. App Crashes on Start

  • Check API endpoint is correct
  • Verify Gradio version compatibility
  • Use app_simple.py instead

3. Authentication Errors

  • Ensure token has WRITE access
  • Re-run deploy script with token:
    ./deploy.sh USERNAME SPACE_NAME YOUR_TOKEN
    

4. Image Processing Errors

  • Verify API key is valid
  • Check Dashscope service is accessible
  • Test locally first with test_local.py

Version Compatibility

Working Configurations:

  • Gradio: 4.19.2 (stable for HF Spaces)
  • Python: 3.10 (HF Spaces default)
  • Pillow: 10.0.0+
  • OpenAI: 1.0.0+

Known Incompatible Versions:

  • Gradio 4.44.1 (API schema bug)
  • Gradio 4.40+ (may have compatibility issues)

Testing Locally

Before deploying, always test:

cd /Users/sangmin/Developer/Qwen2.5-VL/huggingface-space
python test_local.py
# Or test the simple version:
python app_simple.py

Still Having Issues?

  1. Check HF Status: /static-proxy?url=https%3A%2F%2Fstatus.huggingface.co%2F%3C%2Fa%3E%3C%2Fli%3E
  2. Try Different Region: Some regions may have better connectivity
  3. Use Simplified App: app_simple.py has fewer dependencies
  4. Manual Deployment: Upload files directly via web interface

Contact & Support