forked from vegu-ai/talemate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathupdate.sh
43 lines (33 loc) · 979 Bytes
/
update.sh
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
#!/bin/sh
echo "Checking git repository..."
# Initialize git if needed
if [ ! -d ".git" ]; then
git init
git remote add origin https://github.com/vegu-ai/talemate
fi
# Pull latest changes
git pull
# Activate virtual environment
. talemate_env/bin/activate
# Install dependencies with poetry
echo "Updating virtual environment..."
python3 -m poetry install
# Check for CUDA
if command -v nvcc >/dev/null 2>&1; then
echo "CUDA found. Installing PyTorch with CUDA support..."
python3 -m pip uninstall torch torchaudio -y
python3 -m pip install torch~=2.4.1 torchaudio~=2.4.1 --index-url https://download.pytorch.org/whl/cu121
else
echo "CUDA not found. Keeping PyTorch installation without CUDA support..."
fi
echo "Virtual environment updated!"
# Update npm packages
echo "Updating npm packages..."
cd talemate_frontend
npm install
echo "NPM packages updated"
# Build frontend
echo "Building frontend..."
npm run build
cd ..
echo "Update complete"