Merge pull request #938 from pierotofy/notorch

Remove pytorch, stanza
This commit is contained in:
Piero Toffanin 2026-02-10 14:05:03 -05:00 committed by GitHub
commit 2837fb327b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
8 changed files with 6 additions and 15 deletions

View File

@ -1 +1 @@
1.8.4
1.9.0

View File

@ -15,7 +15,6 @@ COPY . .
# Install package from source code, compile translations
RUN ./venv/bin/pip install Babel==2.12.1 && ./venv/bin/python scripts/compile_locales.py \
&& ./venv/bin/pip install torch==$(grep -o -m1 'torch.*;' pyproject.toml|sed 's/[^0-9.]//g') --extra-index-url https://download.pytorch.org/whl/cpu \
&& ./venv/bin/pip install "numpy<2" \
&& ./venv/bin/pip install gunicorn==23.0.0 \
&& ./venv/bin/pip install . \

View File

@ -15,7 +15,6 @@ COPY . .
# Install package from source code, compile translations
RUN ./venv/bin/pip install Babel==2.12.1 && ./venv/bin/python scripts/compile_locales.py \
&& ./venv/bin/pip install torch==2.0.1 --extra-index-url https://download.pytorch.org/whl/cpu \
&& ./venv/bin/pip install "numpy<2" \
&& ./venv/bin/pip install gunicorn==23.0.0 \
&& ./venv/bin/pip install . \

View File

@ -17,8 +17,6 @@ RUN pip3 install --no-cache-dir --upgrade pip && apt-get remove python3-pip --as
RUN ln -s /usr/bin/python3 /usr/bin/python
RUN pip3 install --no-cache-dir torch==1.12.0+cu116 -f https://download.pytorch.org/whl/torch_stable.html
COPY . .
RUN if [ "$with_models" = "true" ]; then \
@ -36,6 +34,7 @@ RUN if [ "$with_models" = "true" ]; then \
RUN pip3 install Babel==2.12.1 && python3 scripts/compile_locales.py \
&& pip3 install "numpy<2" \
&& pip3 install . \
&& pip3 uninstall onnxruntime && pip3 install --no-cache-dir onnxruntime-gpu>=1.10.0 \
&& pip3 cache purge
# Depending on your cuda install you may need to uncomment this line to allow the container to access the cuda libraries

View File

@ -20,7 +20,6 @@ COPY . .
RUN <<EOF
./venv/bin/pip install Babel==2.12.1
./venv/bin/python scripts/compile_locales.py
./venv/bin/pip install torch==2.2.0 --extra-index-url https://download.pytorch.org/whl/cpu
./venv/bin/pip install "numpy<2"
./venv/bin/pip install .
./venv/bin/pip cache purge

View File

@ -20,7 +20,6 @@ COPY . .
RUN <<EOF
./venv/bin/pip install Babel==2.12.1
./venv/bin/python scripts/compile_locales.py
./venv/bin/pip install torch==2.2.0 --extra-index-url https://download.pytorch.org/whl/cpu
./venv/bin/pip install "numpy<2"
./venv/bin/pip install .
./venv/bin/pip cache purge

View File

@ -38,9 +38,6 @@ from libretranslate.locales import (
from .api_keys import Database, RemoteDatabase
from .suggestions import Database as SuggestionsDatabase
# Ignore pytorch complaints
warnings.simplefilter(action='ignore', category=FutureWarning)
# Rough map of emoji characters
emojis = {e: True for e in \
[ord(' ')] + # Spaces

View File

@ -36,7 +36,7 @@ classifiers = [
dynamic = ["version"]
dependencies = [
"argostranslate ==1.11.0",
"argostranslate @ https://github.com/LibreTranslate/argos-translate/archive/refs/tags/v1.12.0.zip",
"Flask ==2.2.5",
"flask-swagger ==0.2.14",
"flask-swagger-ui ==4.11.1",
@ -46,8 +46,6 @@ dependencies = [
"expiringdict ==1.2.2",
"langdetect==1.0.9",
"lexilang==1.0.7",
"morfessor ==2.0.6",
"appdirs ==1.4.4",
"APScheduler ==3.11.2",
"translatehtml ==1.5.2",
"argos-translate-files ==1.4.0",
@ -60,8 +58,6 @@ dependencies = [
"prometheus-client ==0.15.0",
"polib ==1.1.1",
"packaging ==23.1",
"torch ==2.4.0;python_version<'3.12'",
"torch >=2.5.0;python_version>='3.12'",
]
[project.scripts]
@ -89,6 +85,9 @@ History = "https://github.com/LibreTranslate/LibreTranslate/releases"
[tool.hatch.build]
artifacts = ["*.mo"]
[tool.hatch.metadata]
allow-direct-references = true
# ENVIRONMENTS AND SCRIPTS
[tool.hatch.envs.default]
features = [