-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup_env.sh
More file actions
executable file
·76 lines (65 loc) · 1.88 KB
/
Copy pathsetup_env.sh
File metadata and controls
executable file
·76 lines (65 loc) · 1.88 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
#!/bin/bash
# Quick environment setup script using UV
set -e # Exit on error
echo "=========================================="
echo "Impact Echo Evidential Learning Setup"
echo "=========================================="
echo ""
# Check if UV is installed
if ! command -v uv &> /dev/null; then
echo "❌ UV is not installed!"
echo ""
echo "Install UV with one of these methods:"
echo " curl -LsSf https://astral.sh/uv/install.sh | sh"
echo " brew install uv"
echo " pip install uv"
echo ""
exit 1
fi
echo "✓ UV found: $(uv --version)"
echo ""
# Create virtual environment
if [ -d ".venv" ]; then
echo "⚠️ Virtual environment already exists at .venv"
read -p "Remove and recreate? (y/N): " -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]; then
rm -rf .venv
echo "✓ Removed old environment"
else
echo "Using existing environment"
fi
fi
if [ ! -d ".venv" ]; then
echo "Creating virtual environment with Python 3.12.11..."
uv venv --python 3.12.11
echo "✓ Virtual environment created"
fi
echo ""
echo "Activating environment..."
source .venv/bin/activate
echo "✓ Environment activated"
echo ""
# Install dependencies
echo "Installing dependencies..."
echo "This may take a few minutes..."
echo ""
uv pip install -r requirements-uv.txt
echo ""
echo "=========================================="
echo "✓ Setup Complete!"
echo "=========================================="
echo ""
echo "To activate the environment in the future:"
echo " source .venv/bin/activate"
echo ""
echo "To verify installation:"
echo " python -c 'import torch; print(f\"PyTorch: {torch.__version__}\")'"
echo " python -c 'import audiomentations; print(\"Audiomentations OK\")'"
echo ""
echo "To profile training performance:"
echo " python profile_training.py"
echo ""
echo "To start training:"
echo " python train_evidential_model.py"
echo ""