# ๐Ÿชž ืžืจืื•ืช - 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!** ๐Ÿชž