Spaces:
Running
Running
File size: 1,690 Bytes
ca5173a |
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 |
#!/usr/bin/env python3
"""
Test script for the voice conversation feature.
Run this to test the voice conversation functionality.
"""
import os
import sys
# Add the src directory to the path
sys.path.insert(0, os.path.join(os.path.dirname(__file__), 'src'))
try:
from fitness_gradio.ui.app import FitnessAppUI
print("β
Successfully imported FitnessAppUI")
# Test creating the app
app = FitnessAppUI()
print("β
Successfully created FitnessAppUI instance")
# Test getting the demo
demo = app.get_demo()
print("β
Successfully got Gradio demo")
print("\nπ Voice conversation feature is ready!")
print("\nπ To launch the app, run:")
print("python scripts/run_gradio.py")
print("\nπ Voice Conversation Features:")
print("- π€ Start Voice Conversation button")
print("- π Automatic voice activity detection (VAD)")
print("- π£οΈ Speech-to-text using Groq Whisper")
print("- π€ AI responses using your selected model")
print("- π Text-to-speech using Groq TTS")
print("- π¬ Chat history preserved in main conversation")
print("- β Exit button to end voice chat")
print("\nβ οΈ Requirements:")
print("- GROQ_API_KEY environment variable must be set")
print("- Microphone access will be requested by the browser")
print("- Modern browser with JavaScript enabled")
except ImportError as e:
print(f"β Import error: {e}")
print("\nTry installing missing dependencies:")
print("pip install gradio groq soundfile")
except Exception as e:
print(f"β Error: {e}")
print("\nPlease check your setup and try again.")
|