-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
29 lines (24 loc) · 918 Bytes
/
main.py
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
import os
from voice_assistant import VoiceAssistant
def main():
# Initialize components
api_key = os.getenv("OPENROUTER_API_KEY")
if not api_key:
raise ValueError("Please set OPENROUTER_API_KEY environment variable")
use_gpu = False
try:
import torch
if torch.cuda.is_available():
use_gpu = True
print("GPU available. Using GPU for TTS.")
except ImportError:
pass
# Initialize voice assistant
assistant = VoiceAssistant(api_key,
tts_model_path="/home/besher/Documents/tools/piper/en_US-ljspeech-high.onnx",
tts_config_path="/home/besher/Documents/tools/piper/en_en_US_ljspeech_high_en_US-ljspeech-high.onnx.json",
use_gpu=use_gpu)
# Process voice input
assistant.process_voice_input()
if __name__ == "__main__":
main()