mirrors / DEPLOYMENT.md
Shim
Add all project files with proper .gitignore for Hugging Face deployment
a67f1bb

A newer version of the Gradio SDK is available: 6.1.0

Upgrade

πŸš€ Deployment Guide: ΧžΧ¨ΧΧ•Χͺ to Hugging Face Spaces

This guide will help you deploy the ΧžΧ¨ΧΧ•Χͺ (Mirrors) application to your Hugging Face Space.

πŸ“‹ Pre-deployment Checklist

Files Ready for Upload:

  • βœ… app.py - Main application (optimized for HF Spaces)
  • βœ… requirements.txt - Dependencies
  • βœ… README.md - Documentation
  • βœ… prompt_engineering.py - Hebrew personas module
  • βœ… conversation_manager.py - Session management
  • βœ… app_config.py - Configuration for HF deployment
  • βœ… .gitignore - Ignore unnecessary files

🌐 Deployment Steps

Option 1: Git Upload (Recommended)

  1. Clone your HF Space repository:

    git clone https://huggingface.co/spaces/shim5/mirrors
    cd mirrors
    
  2. Copy application files:

    # Copy all the Python files
    cp /path/to/your/project/*.py .
    cp /path/to/your/project/requirements.txt .
    cp /path/to/your/project/README.md .
    cp /path/to/your/project/.gitignore .
    
  3. Commit and push:

    git add .
    git commit -m "Deploy ΧžΧ¨ΧΧ•Χͺ Hebrew Self-Reflective AI Agent"
    git push
    

Option 2: Direct Web Upload

  1. Go to https://huggingface.co/spaces/shim5/mirrors
  2. Click "Files" tab
  3. Upload each file individually:
    • app.py
    • requirements.txt
    • README.md
    • prompt_engineering.py
    • conversation_manager.py
    • app_config.py

πŸ”§ HF Spaces Configuration

Your Space should be configured as:

  • SDK: Gradio
  • Python Version: 3.9+
  • Hardware: CPU Basic (free tier)
  • Visibility: Public

🎯 Expected Behavior

  1. Build Time: ~3-5 minutes for dependency installation
  2. First Load: May take 1-2 minutes to load the Hebrew model
  3. Fallback Mode: If model loading fails, app will run in demo mode
  4. Performance: Response time ~2-5 seconds per message

πŸ› Troubleshooting

Common Issues:

  1. Build Fails:

    • Check requirements.txt formatting
    • Ensure all Python files are valid syntax
  2. Model Loading Issues:

    • App will automatically fall back to demo mode
    • Check logs for specific errors
  3. Hebrew Text Issues:

    • Ensure browser supports RTL text
    • Check CSS is loading correctly

Debug Mode:

To enable debug logging, modify app_config.py:

HF_SPACES_CONFIG = {
    "debug": True,
    # ... other settings
}

πŸ“Š Monitoring

After deployment:

  1. Check the build logs in HF Spaces
  2. Test the 3-step user flow
  3. Verify Hebrew text displays correctly
  4. Test conversation with different parts

πŸŽ‰ Success Indicators

βœ… App loads without errors
βœ… Hebrew interface displays correctly
βœ… All 5 psychological parts are selectable
βœ… Conversations flow smoothly
βœ… User can customize persona names
βœ… Session state persists during conversation

πŸ”„ Updates

To update the deployed app:

  1. Modify files locally
  2. Re-upload to HF Space
  3. Space will automatically rebuild

Ready to deploy! πŸš€