-
Notifications
You must be signed in to change notification settings - Fork 132
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·69 lines (56 loc) · 1.81 KB
/
install.sh
File metadata and controls
executable file
·69 lines (56 loc) · 1.81 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
#!/bin/bash
# Chatterbox TTS API Installation Script
set -e
echo "🚀 Installing Chatterbox TTS API..."
# Check Python version
python_version=$(python3 --version 2>&1 | grep -oP '(?<=Python )\d+\.\d+')
required_version="3.11"
if ! python3 -c "import sys; exit(0 if sys.version_info >= (3, 11) else 1)" 2>/dev/null; then
echo "❌ Error: Python 3.11 is required. Found: $python_version"
exit 1
fi
echo "✅ Python version check passed: $python_version"
# Create virtual environment
if [ ! -d "venv" ]; then
echo "📦 Creating virtual environment..."
python3 -m venv venv
fi
# Activate virtual environment
echo "🔧 Activating virtual environment..."
source venv/bin/activate
# Upgrade pip
echo "⬆️ Upgrading pip..."
pip install --upgrade pip
# Install dependencies
echo "📥 Installing dependencies..."
pip install -r requirements.txt
# Copy environment file if it doesn't exist
if [ ! -f ".env" ]; then
echo "⚙️ Creating environment configuration..."
cp env.example .env
echo "📝 Please edit .env to customize your configuration"
fi
# Check if voice sample exists
if [ ! -f "voice-sample.mp3" ]; then
echo "⚠️ Warning: voice-sample.mp3 not found"
echo " You can add your own voice sample or use the provided one"
fi
echo ""
echo "🎉 Installation complete!"
echo ""
echo "To start the API:"
echo " source venv/bin/activate"
echo " python api.py"
echo ""
echo "Alternative with uv (faster, better dependency resolution):"
echo " uv sync && uv run api.py"
echo " See docs/UV_MIGRATION.md for details"
echo ""
echo "Or with Docker:"
echo " docker compose up -d"
echo ""
echo "Test the API:"
echo " curl -X POST http://localhost:4123/v1/audio/speech \\"
echo " -H 'Content-Type: application/json' \\"
echo " -d '{\"input\": \"Hello world!\"}' \\"
echo " --output test.wav"