| # Local Testing Guide | |
| ## Quick Test (Recommended) | |
| Test just the audio generation: | |
| ```bash | |
| # Activate virtual environment | |
| source .venv/bin/activate | |
| # Run quick test | |
| python quick_test.py | |
| ``` | |
| This will generate a short audio sample to verify Kokoro-82M TTS works. | |
| ## Full Gradio App | |
| To run the complete app locally: | |
| ```bash | |
| # Activate virtual environment | |
| source .venv/bin/activate | |
| # Set environment variables (or create .env file) | |
| export HUGGINGFACE_TOKEN=your_token_here | |
| export ANTHROPIC_API_KEY=your_anthropic_key_here | |
| export SEMANTIC_SCHOLAR_API=your_scholar_key_here # Optional | |
| # Run the app | |
| python app.py | |
| ``` | |
| Then open your browser to `http://localhost:7860` | |
| ## What to Test | |
| 1. **Audio Generation** - Run `quick_test.py` to verify Kokoro-82M works | |
| 2. **Paper Search** - Enter a topic like "AlphaFold" or "CRISPR" | |
| 3. **Full Workflow** - Generate a complete podcast from a research paper | |
| 4. **UI/UX** - Check that all tabs display correctly | |
| 5. **Error Handling** - Try invalid inputs to see error messages | |
| ## Expected Output | |
| - **Audio files** saved to `assets/audio/` | |
| - **WAV format** (Kokoro-82M native format) | |
| - **File sizes** ~900KB-1MB per minute of audio | |
| - **Quality** Much better than gTTS, similar to commercial TTS | |
| ## Troubleshooting | |
| ### "No module named 'huggingface_hub'" | |
| ```bash | |
| pip install huggingface-hub | |
| ``` | |
| ### "HUGGINGFACE_TOKEN not set" | |
| Make sure you've exported the environment variable or created a `.env` file. | |
| ### "Port 7860 already in use" | |
| ```bash | |
| GRADIO_SERVER_PORT=7861 python app.py | |
| ``` | |
| ## Requirements | |
| - Python 3.10+ | |
| - Internet connection (for API calls) | |
| - Hugging Face token (free at https://huggingface.co/settings/tokens) | |
| - Anthropic API key (for Claude AI) | |