| # π 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:** | |
| ```bash | |
| git clone https://huggingface.co/spaces/shim5/mirrors | |
| cd mirrors | |
| ``` | |
| 2. **Copy application files:** | |
| ```bash | |
| # 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:** | |
| ```bash | |
| 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`: | |
| ```python | |
| 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! π** |