-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·72 lines (58 loc) · 2.06 KB
/
setup.sh
File metadata and controls
executable file
·72 lines (58 loc) · 2.06 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
#!/bin/bash
# Faster Whisper Setup Script for macOS
# This script sets up the environment for real-time transcription testing
set -e # Exit on any error
echo "🚀 Setting up Faster Whisper Real-time Transcription Test"
echo "=================================================="
# Check if Homebrew is installed
if ! command -v brew &> /dev/null; then
echo "❌ Homebrew is not installed. Please install it first:"
echo " /bin/bash -c \"\$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)\""
exit 1
fi
# Check Python version
python_version=$(python3 --version 2>&1 | cut -d' ' -f2 | cut -d'.' -f1,2)
required_version="3.8"
if [ "$(printf '%s\n' "$required_version" "$python_version" | sort -V | head -n1)" != "$required_version" ]; then
echo "❌ Python 3.8+ is required. Current version: $python_version"
echo " Please upgrade Python or use pyenv to manage Python versions."
exit 1
fi
echo "✅ Python version: $python_version"
# Install system dependencies
echo "📦 Installing system dependencies..."
brew install portaudio
# Create virtual environment
echo "🐍 Creating Python virtual environment..."
python3 -m venv venv
# Activate virtual environment
echo "🔧 Activating virtual environment..."
source venv/bin/activate
# Upgrade pip
echo "⬆️ Upgrading pip..."
pip install --upgrade pip
# Install Python dependencies
echo "📚 Installing Python dependencies..."
pip install -r requirements.txt
# Test installation
echo "🧪 Testing installation..."
python3 -c "
import faster_whisper
import sounddevice
import numpy
print('✅ All dependencies installed successfully!')
"
echo ""
echo "🎉 Setup complete! You can now run:"
echo ""
echo " # Activate the virtual environment:"
echo " source venv/bin/activate"
echo ""
echo " # Run real-time transcription test:"
echo " python realtime_transcription_test.py"
echo ""
echo " # Run benchmark tests:"
echo " python benchmark_test.py"
echo ""
echo "📝 Note: You may need to grant microphone access in System Preferences > Security & Privacy > Microphone"
echo ""