Skip to content

Commit 0c836ef

Browse files
authored
Merge pull request #1116 from PyThaiNLP/update-docker-fairseq
Update docker and fairseq
2 parents 8a5a57e + ad0d2ea commit 0c836ef

File tree

3 files changed

+31
-32
lines changed

3 files changed

+31
-32
lines changed

Dockerfile

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,13 @@
22
# SPDX-FileType: SOURCE
33
# SPDX-License-Identifier: Apache-2.0
44

5-
FROM python:3.8-slim-buster
5+
FROM python:3.12
66

77
COPY . .
88

9-
RUN apt-get update && apt-get install -y --no-install-recommends build-essential libicu-dev libicu63 pkg-config && rm -rf /var/lib/apt/lists/*
10-
11-
RUN pip3 install --upgrade pip setuptools
12-
RUN if [ -f docker_requirements.txt ]; then pip3 install -r docker_requirements.txt; fi
13-
RUN pip3 install -e .[full] && pip3 cache purge
9+
RUN apt-get update && apt-get install -y --no-install-recommends build-essential libicu-dev python3-pip python3-venv pkg-config && rm -rf /var/lib/apt/lists/*
10+
ENV VIRTUAL_ENV=/opt/venv
11+
RUN python3 -m venv $VIRTUAL_ENV
12+
ENV PATH="$VIRTUAL_ENV/bin:$PATH"
13+
RUN if [ -f docker_requirements.txt ]; then pip install -r docker_requirements.txt; fi
14+
RUN pip install -e .[full] && pip cache purge

docker_requirements.txt

Lines changed: 20 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,37 @@
1-
PyYAML==5.4.1
1+
PyYAML>=5.4.1,<6.0.2
22
attacut==1.0.6
3-
bpemb==0.3.6
3+
bpemb>=0.3.6,<0.4
44
deepcut==0.7.0.0
5-
emoji==0.6.0
5+
emoji>=0.6.0,<1
66
epitran==1.26.0
7-
esupar==1.3.9
8-
fairseq==0.12.2
9-
fastai==1.0.61
7+
esupar>=1.3.9,<2
8+
fairseq>=0.10.0,<0.13;python_version<"3.11"
9+
fairseq-fixed==0.12.3.1,<0.13;python_version>="3.11"
10+
fastai>=1.0.61,<2
1011
fastcoref==2.1.6
11-
gensim==4.3.3
12-
h5py==3.13.0
13-
khanaa==0.0.6
14-
nlpo3==1.3.1
15-
nltk==3.6.6
16-
numpy==1.26.*
17-
OSKut==1.3
18-
pandas==2.2.*
12+
gensim>=4.3.3,<5
13+
khanaa>=0.1.1,<1
14+
nlpo3>=1.3.1
15+
nltk>=3.6.6,<4
16+
numpy>=1.26.0,<2
17+
pandas>=2.2.0,<3
1918
panphon==0.21.2
2019
phunspell==0.1.6
21-
protobuf==5.29.3
22-
pyicu==2.15.2
20+
pyicu>=2.15.2,<3
2321
python-crfsuite==0.9.11
24-
requests==2.32.*
22+
requests>=2.32.0,<2.33
2523
sacremoses==0.1.1
26-
sefr_cut==1.1
27-
sentence-transformers==2.7.0
24+
sentence-transformers>=2.7.0,<3
2825
sentencepiece==0.2.0
2926
spacy_thai==0.7.8
30-
spacy==3.5.*
27+
spacy==3.8.7,<4
3128
ssg==0.0.8
3229
symspellpy==6.9.0
33-
tensorflow==2.18.1
3430
thai-nner==0.3
35-
tltk==1.6.8
36-
torch==1.13.1
31+
tltk>=1.6.8,<2
32+
torch>=1.13.1,<3
3733
transformers==4.52.3
3834
ufal.chu-liu-edmonds==1.0.3
3935
wtpsplit==1.3.0
4036
wunsen==0.0.3
41-
word2word==1.0.0
37+
word2word>=1.0.0,<2

setup.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,8 @@
8080
"thai2fit": ["emoji>=0.5.1", "gensim>=4.0.0", "numpy>=1.22"],
8181
"thai2rom": ["numpy>=1.22", "torch>=1.0.0"],
8282
"translate": [
83-
"fairseq>=0.10.0",
83+
'fairseq>=0.10.0,<0.13;python_version<"3.11"',
84+
'fairseq-fixed==0.12.3.1,<0.13;python_version>="3.11"',
8485
"sacremoses>=0.0.41",
8586
"sentencepiece>=0.1.91",
8687
"torch>=1.0.0",
@@ -117,7 +118,8 @@
117118
"bpemb>=0.3.2",
118119
"emoji>=0.5.1",
119120
"epitran>=1.1",
120-
"fairseq>=0.10.0",
121+
'fairseq>=0.10.0,<0.13;python_version<"3.11"',
122+
'fairseq-fixed==0.12.3.1,<0.13;python_version>="3.11"',
121123
"fastai<2.0",
122124
"fastcoref>=2.1.5",
123125
"gensim>=4.0.0",

0 commit comments

Comments
 (0)