-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathsetup.py
More file actions
122 lines (108 loc) · 3.95 KB
/
setup.py
File metadata and controls
122 lines (108 loc) · 3.95 KB
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
#!/usr/bin/env python3
"""
VoiceForge AI Setup Script
Helps users install and configure the system
"""
import os
import sys
import subprocess
import requests
from pathlib import Path
def print_banner():
print("""
🤖 VoiceForge AI Setup
======================
Intelligent Emotion Detection for Text-to-Speech
""")
def check_python_version():
"""Check if Python version is compatible."""
if sys.version_info < (3, 10):
print("❌ Python 3.10+ required. Current version:", sys.version)
return False
print("✅ Python version:", sys.version.split()[0])
return True
def check_ollama():
"""Check if Ollama is installed and running."""
try:
response = requests.get("http://localhost:11434/api/tags", timeout=5)
if response.status_code == 200:
print("✅ Ollama is running")
models = response.json().get("models", [])
mistral_found = any("mistral" in model.get("name", "").lower() for model in models)
if mistral_found:
print("✅ Mistral model found")
else:
print("⚠️ Mistral model not found. Run: ollama pull mistral:7b-instruct")
return True
else:
print("❌ Ollama not responding")
return False
except:
print("❌ Ollama not running. Install from: https://ollama.ai")
return False
def install_dependencies():
"""Install Python dependencies."""
print("\n📦 Installing Python dependencies...")
try:
subprocess.run([sys.executable, "-m", "pip", "install", "-r", "requirements.txt"],
check=True, capture_output=True)
print("✅ Dependencies installed successfully")
return True
except subprocess.CalledProcessError as e:
print(f"❌ Failed to install dependencies: {e}")
return False
def check_models():
"""Check if OpenAudio S1 Mini models are available."""
model_path = Path("models/openaudio-s1-mini")
if model_path.exists():
print("✅ OpenAudio S1 Mini models found")
return True
else:
print("⚠️ OpenAudio S1 Mini models not found")
print(" Download from: https://huggingface.co/fishaudio/fish-speech-1.5")
print(" Place in: models/openaudio-s1-mini/")
return False
def run_status_check():
"""Run the status check script."""
print("\n🔍 Running system status check...")
try:
subprocess.run([sys.executable, "check_status.py"], check=True)
return True
except subprocess.CalledProcessError:
print("❌ Status check failed")
return False
except FileNotFoundError:
print("⚠️ Status check script not found")
return False
def main():
print_banner()
# Check system requirements
if not check_python_version():
sys.exit(1)
# Install dependencies
if not install_dependencies():
print("\n❌ Setup failed. Please install dependencies manually:")
print(" pip install -r requirements.txt")
sys.exit(1)
# Check components
ollama_ok = check_ollama()
models_ok = check_models()
# Run status check if available
run_status_check()
# Final instructions
print("\n" + "="*50)
if ollama_ok and models_ok:
print("🎉 Setup complete! You're ready to use VoiceForge AI")
print("\n🚀 To start the interface:")
print(" python openaudio_mistral_ai.py")
print("\n🌐 Then open: http://localhost:7866")
else:
print("⚠️ Setup incomplete. Please address the issues above:")
if not ollama_ok:
print(" • Install and start Ollama: https://ollama.ai")
print(" • Pull Mistral model: ollama pull mistral:7b-instruct")
if not models_ok:
print(" • Download OpenAudio S1 Mini models")
print("\n🔄 Run this script again after fixing the issues")
if __name__ == "__main__":
main()