-
Notifications
You must be signed in to change notification settings - Fork 0
/
Update.sh
42 lines (32 loc) · 1.27 KB
/
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
#!/bin/bash
git pull
sleep 3
clear
CURRENT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" &> /dev/null && pwd)"
source "$CURRENT_DIR/venv/bin/activate"
echo "Setting up local pip cache..."
mkdir -p "$CURRENT_DIR/TechnicalFiles/pip_cache"
export PIP_CACHE_DIR="$CURRENT_DIR/TechnicalFiles/pip_cache"
echo "Updating dependencies..."
mkdir -p "$CURRENT_DIR/TechnicalFiles/logs"
ERROR_LOG="$CURRENT_DIR/TechnicalFiles/logs/update_errors.log"
touch "$ERROR_LOG"
python3 -m pip install --upgrade pip
pip install wheel setuptools
pip install --no-deps -r "$CURRENT_DIR/RequirementsFiles/requirements.txt" 2>> "$ERROR_LOG"
pip install --no-deps -r "$CURRENT_DIR/RequirementsFiles/requirements-cuda.txt" 2>> "$ERROR_LOG"
pip install --no-deps -r "$CURRENT_DIR/RequirementsFiles/requirements-llama-cpp.txt" 2>> "$ERROR_LOG"
pip install --no-deps -r "$CURRENT_DIR/RequirementsFiles/requirements-stable-diffusion-cpp.txt" 2>> "$ERROR_LOG"
sleep 3
clear
echo "Checking for update errors..."
if grep -iq "error" "$ERROR_LOG"; then
echo "Some packages failed to install. Please check $ERROR_LOG for details."
else
echo "All packages installed successfully."
fi
sleep 5
clear
echo "Application update process completed. Run start.sh to launch the application."
deactivate
read -p "Press enter to continue"