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! πŸš€**