File size: 3,923 Bytes
f095630 |
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 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 |
# πͺ ΧΧ¨ΧΧΧͺ - Startup Guide
## π Quick Start (Fixed!)
The app is now fixed and has multiple reliable startup options:
### Option 1: One-Command Startup (Recommended)
```bash
python run_local.py
```
### Option 2: Direct Simple App
```bash
python simple_app.py
```
### Option 3: Main App (Advanced)
```bash
python app.py
```
## β
What Was Fixed
### 1. **Static Response Problem** β **Dynamic Hebrew Personas**
- **Before**: English gibberish like ", unlawJewsIsrael"
- **After**: Rich Hebrew responses like "ΧΧ Χ ΧΧ Χ, ΧΧ§ΧΧ ΧΧΧΧ§ΧΧ¨ΧͺΧ Χ©ΧΧ. Χ©ΧΧ’ΧͺΧ ΧΧ Χ©ΧΧΧ¨Χͺ..."
### 2. **Local Running Issues** β **Robust Startup System**
- **Before**: Gradio schema errors causing crashes
- **After**: Multiple fallback options, reliable startup
### 3. **Environment Inconsistency** β **Unified Experience**
- **Before**: Different behavior locally vs HF Spaces
- **After**: Same experience everywhere
## π― How It Works Now
### Template-Based Response System
Each of the 5 personas has multiple response templates:
- **ΧΧ§ΧΧ ΧΧΧΧ§ΧΧ¨ΧͺΧ (The Critic)**: Challenging, analytical responses
- **ΧΧΧΧ/Χ ΧΧ€Χ ΧΧΧΧͺ (Inner Child)**: Vulnerable, emotional responses
- **ΧΧΧ¨Χ¦Χ (The Pleaser)**: Harmony-seeking, conflict-avoiding responses
- **ΧΧΧΧ (The Protector)**: Strong, defensive responses
- **ΧΧ ΧΧ Χ’/Χͺ (The Avoider)**: Hesitant, withdrawal-oriented responses
### Smart Context Adaptation
- Responses adapt to emotional keywords (Χ€ΧΧ, ΧΧ’Χ‘, etc.)
- Remembers initial user context
- Builds on conversation history
- Uses personalized names when provided
## π§ Troubleshooting
### If `python run_local.py` fails:
```bash
# Try direct simple app
python simple_app.py
# Check dependencies
pip install -r requirements.txt
# Specific Gradio version if needed
pip install gradio==4.44.0
```
### Common Issues & Solutions:
**Port Already in Use:**
- The script automatically finds available ports
- Starts from 7861 and searches upward
**Gradio Schema Errors:**
- Fixed by disabling API schema generation
- All startup scripts now include `show_api=False`
**Model Loading Issues:**
- App now works completely without models
- Template-based responses are the primary system
- Model enhancement is optional bonus
**Virtual Environment Issues:**
```bash
# Create new venv if needed
python -m venv venv
source venv/bin/activate # On macOS/Linux
pip install -r requirements.txt
```
## π Deployment to HF Spaces
Upload these files to your HF Space:
- `app.py` (main application)
- `requirements.txt` (fixed dependencies)
- `prompt_engineering.py` (personas)
- `conversation_manager.py` (session management)
- `README.md` (documentation)
The Space will automatically run `app.py` and work identically to local.
## π§ͺ Testing Your Setup
Run the test script to verify everything works:
```bash
python test_startup.py
```
Expected output:
```
β
All tests passed! The app should work with run_local.py
```
## π Success Indicators
When working correctly, you should see:
- β
Hebrew interface loads properly
- β
All 5 personas are selectable
- β
Responses are in Hebrew with proper context
- β
Conversations flow naturally
- β
Status shows "ΧΧ’Χ¨ΧΧͺ ΧͺΧΧΧΧΧͺ ΧΧΧͺΧΧΧͺ ΧΧΧ©ΧΧͺ Χ€Χ’ΧΧΧ"
## π‘ Tips for Best Experience
1. **Fill in the initial context** - helps personalize responses
2. **Try different personas** - each has unique personality
3. **Use custom names** - makes conversations more personal
4. **Ask emotional questions** - responses adapt to emotional content
## π Development Workflow
1. **Local Development**: Use `python run_local.py`
2. **Testing**: Use `python simple_test.py` for model testing
3. **Deployment**: Upload to HF Spaces
4. **Debugging**: Check logs for specific error messages
---
πͺ **Your ΧΧ¨ΧΧΧͺ app is now fully functional with authentic Hebrew personas!** πͺ |