-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·69 lines (54 loc) · 1.98 KB
/
Copy pathsetup.sh
File metadata and controls
executable file
·69 lines (54 loc) · 1.98 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
#!/bin/bash
# Setup script for macOS/Linux
# Creates virtual environment and installs dependencies
set -e
echo "🚀 Setting up SeamlessM4T S2ST Translator..."
# Check Python version
python_version=$(python3 --version 2>&1 | awk '{print $2}' | cut -d. -f1,2)
required_version="3.9"
if [ "$(printf '%s\n' "$required_version" "$python_version" | sort -V | head -n1)" != "$required_version" ]; then
echo "❌ Error: Python 3.9+ required. Found: $python_version"
exit 1
fi
echo "✅ Python version: $python_version"
# Create virtual environment
if [ ! -d "venv" ]; then
echo "📦 Creating virtual environment..."
python3 -m venv venv
else
echo "✅ Virtual environment already exists"
fi
# Activate virtual environment
echo "🔌 Activating virtual environment..."
source venv/bin/activate
# Upgrade pip
echo "⬆️ Upgrading pip..."
pip install --upgrade pip setuptools wheel
# Install dependencies
echo "📥 Installing dependencies..."
pip install -r requirements.txt
# Optional dependencies (commented out in requirements.txt):
# - fairseq2: Not required - transformers includes SeamlessM4T v2
# - silero-vad: Not required - simple RMS-based VAD is used by default
# If you need these, install separately:
# pip install fairseq2 # May require fairseq2n which has platform-specific builds
# pip install silero-vad # Requires onnxruntime which may not be available on all platforms
# Install dev dependencies if available
if [ -f "requirements-dev.txt" ]; then
echo "📥 Installing development dependencies..."
pip install -r requirements-dev.txt
fi
# Create necessary directories
echo "📁 Creating directories..."
mkdir -p input output/translated output/metadata output/logs output/backups config
# Create .gitkeep files if needed
touch input/.gitkeep 2>/dev/null || true
echo ""
echo "✅ Setup complete!"
echo ""
echo "To activate the virtual environment, run:"
echo " source venv/bin/activate"
echo ""
echo "To start using the tool, run:"
echo " ./run.sh --help"
echo ""