File size: 3,024 Bytes
a67f1bb |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 |
# π 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! π** |