File tree Expand file tree Collapse file tree 2 files changed +18
-10
lines changed
Expand file tree Collapse file tree 2 files changed +18
-10
lines changed Original file line number Diff line number Diff line change @@ -28,21 +28,24 @@ function update_script() {
2828 msg_error " No ${APP} Installation Found!"
2929 exit
3030 fi
31+
32+ setup_uv
33+
3134 if check_for_gh_release " libretranslate" " LibreTranslate/LibreTranslate" ; then
32- msg_info " Stopping $APP "
35+ msg_info " Stopping Service "
3336 systemctl stop libretranslate
34- msg_ok " Stopped $APP "
37+ msg_ok " Stopped Service "
3538
36- msg_info " Updating $APP "
39+ msg_info " Updating LibreTranslate "
3740 cd /opt/libretranslate
3841 source .venv/bin/activate
3942 $STD pip install -U libretranslate
40- msg_ok " Updated $APP "
43+ msg_ok " Updated LibreTranslate "
4144
42- msg_info " Starting $APP "
45+ msg_info " Starting Service "
4346 systemctl start libretranslate
44- msg_ok " Started $APP "
45- msg_ok " Update Successful "
47+ msg_ok " Started Service "
48+ msg_ok " Update Successfully! "
4649 fi
4750 exit
4851}
Original file line number Diff line number Diff line change @@ -14,9 +14,9 @@ network_check
1414update_os
1515
1616msg_info " Installing dependencies"
17- $STD apt install -y --no-install-recommends \
17+ $STD apt install -y \
1818 pkg-config \
19- gcc \
19+ build-essentials \
2020 g++ \
2121 libicu-dev
2222msg_ok " Installed dependencies"
@@ -32,13 +32,18 @@ setup_uv
3232fetch_and_deploy_gh_release " libretranslate" " LibreTranslate/LibreTranslate"
3333
3434msg_info " Setup LibreTranslate (Patience)"
35+ TORCH_VERSION=$( grep -Eo ' "torch ==[0-9]+\.[0-9]+\.[0-9]+' /opt/libretranslate/pyproject.toml | \
36+ tail -n1 | sed ' s/.*==//' )
37+ if [[ -z " $TORCH_VERSION " ]]; then
38+ TORCH_VERSION=" 2.5.0"
39+ fi
3540cd /opt/libretranslate
3641$STD uv venv .venv
3742$STD source .venv/bin/activate
3843$STD uv pip install --upgrade pip setuptools
3944$STD uv pip install Babel==2.12.1
4045$STD .venv/bin/python scripts/compile_locales.py
41- $STD uv pip install torch==2.2.0 --extra-index-url https://download.pytorch.org/whl/cpu
46+ $STD uv pip install " torch==${TORCH_VERSION} " --extra-index-url https://download.pytorch.org/whl/cpu
4247$STD uv pip install " numpy<2"
4348$STD uv pip install .
4449$STD uv pip install libretranslate
You can’t perform that action at this time.
0 commit comments