Skip to content

Commit 9a62e33

Browse files
committed
cpu & gpu versions for most taggers & pie model update
1 parent 62a9c7b commit 9a62e33

46 files changed

Lines changed: 410 additions & 1135 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/dev-to-docker.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,6 @@ jobs:
2020
password: ${{ secrets.DOCKERHUB_TOKEN }}
2121

2222
- name: Build and push
23-
run: ./buildandpushall.sh
23+
run: ./push-and-build.sh
2424
env:
2525
VERSION: dev

.github/workflows/prod-to-docker.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@ jobs:
2121
password: ${{ secrets.DOCKERHUB_TOKEN }}
2222

2323
- name: Build and push
24-
run: ./buildandpushall.sh
24+
run: ./push-and-build.sh
2525
env:
26-
VERSION: latest
26+
VERSION: $GITHUB_REF_NAME

TaggerAPITest.py

Lines changed: 0 additions & 68 deletions
This file was deleted.

base/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM python:3.13.2-slim-bookworm
1+
FROM python:3.12.9-slim-bookworm
22

33
# Copy python source and requirements.
44
COPY . ./

base/process.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
"""
2-
Initialize the tagger if needed and process input files by calling the specific tagger implementation
2+
Initialize the tagger if needed and process input files by calling the specific tagger implementation
33
and ensuring the output is written to the expected file.
44
"""
55

base/tagger_worker.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
"""
22
Acts as a daemon that checks on an interval if there are any pending tasks (i.e. documents) to be processed.
3-
It then processes them one by one (i.e. running the tagger process), keeps track of their statusses,
3+
It then processes them one by one (i.e. running the tagger process), keeps track of their statusses,
44
and sends the results to the callback server. The server then responds with KEEP or DELETE,
55
which determines if the resulting tagged output file is kept or deleted.
66
Input files are deleted automatically after processing, or moved to the error folder if processing fails.
77
88
We use a multiprocessing pool to process files, because we want to kill the process if needed.
9-
Additonally the taggers need to be initialized only once (and in the same thread),
9+
Additonally the taggers need to be initialized only once (and in the same thread),
1010
so that can be done at pool initialization.
1111
"""
1212

base/webservice.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
File are processed automatically once uploaded, with the result being sent back to the callback server.
66
Input files are deleted automatically after being processed.
77
8-
Deleting files also stops the tagger if that file was being processed.
8+
Deleting files also stops the tagger if that file was being processed.
99
(Thus, deleting all input files is equivalent to stopping the tagger.)
1010
"""
1111

build.sh

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# load the .env file
2+
source .env
3+
4+
# Set the default label
5+
: ${VERSION:=latest}
6+
7+
echo "Will build taggers with version <$VERSION>. Set VERSION to override this."
8+
9+
# Base image
10+
docker build -t instituutnederlandsetaal/galahad-taggers-base:$VERSION base
11+
12+
# PIE
13+
# base
14+
docker build --build-arg VERSION=$VERSION --build-arg CPU_GPU=cpu -t instituutnederlandsetaal/galahad-taggers-pie-cpu-base:$VERSION pie/base
15+
docker build --build-arg VERSION=$VERSION --build-arg CPU_GPU=gpu -t instituutnederlandsetaal/galahad-taggers-pie-gpu-base:$VERSION pie/base
16+
# all
17+
docker build --build-arg VERSION=$VERSION --build-arg CPU_GPU=cpu -t instituutnederlandsetaal/galahad-taggers-pie-cpu-tdn-all:$VERSION pie/TDN-ALL
18+
docker build --build-arg VERSION=$VERSION --build-arg CPU_GPU=gpu -t instituutnederlandsetaal/galahad-taggers-pie-gpu-tdn-all:$VERSION pie/TDN-ALL
19+
# tdn-1200-1600
20+
docker build --build-arg VERSION=$VERSION --build-arg CPU_GPU=cpu -t instituutnederlandsetaal/galahad-taggers-pie-cpu-tdn-1200-1600:$VERSION pie/TDN-1200-1600
21+
docker build --build-arg VERSION=$VERSION --build-arg CPU_GPU=gpu -t instituutnederlandsetaal/galahad-taggers-pie-gpu-tdn-1200-1600:$VERSION pie/TDN-1200-1600
22+
# tdn-1600-1900
23+
docker build --build-arg VERSION=$VERSION --build-arg CPU_GPU=cpu -t instituutnederlandsetaal/galahad-taggers-pie-cpu-tdn-1600-1900:$VERSION pie/TDN-1600-1900
24+
docker build --build-arg VERSION=$VERSION --build-arg CPU_GPU=gpu -t instituutnederlandsetaal/galahad-taggers-pie-gpu-tdn-1600-1900:$VERSION pie/TDN-1600-1900
25+
26+
# UD-parsers
27+
# flair
28+
docker build --build-arg VERSION=$VERSION --build-arg CPU_GPU=cpu -t instituutnederlandsetaal/galahad-taggers-flair-cpu:$VERSION flair
29+
docker build --build-arg VERSION=$VERSION --build-arg CPU_GPU=gpu -t instituutnederlandsetaal/galahad-taggers-flair-gpu:$VERSION flair
30+
# # spacy
31+
#docker build --build-arg VERSION=$VERSION --build-arg SPACY_MODEL=nl_core_news_lg --build-arg CPU_GPU=cpu -t instituutnederlandsetaal/galahad-taggers-spacy-cpu:$VERSION spacy
32+
# docker build --build-arg VERSION=$VERSION --build-arg SPACY_MODEL=nl_core_news_lg --build-arg CPU_GPU=gpu -t instituutnederlandsetaal/galahad-taggers-spacy-gpu:$VERSION spacy
33+
# stanza
34+
docker build --build-arg VERSION=$VERSION --build-arg CPU_GPU=cpu -t instituutnederlandsetaal/galahad-taggers-stanza-cpu:$VERSION stanza
35+
docker build --build-arg VERSION=$VERSION --build-arg CPU_GPU=gpu -t instituutnederlandsetaal/galahad-taggers-stanza-gpu:$VERSION stanza
36+
# udpipe
37+
# docker build --build-arg VERSION=$VERSION -t instituutnederlandsetaal/galahad-taggers-udpipe:$VERSION udpipe
38+
# docker build --build-arg VERSION=$VERSION -t instituutnederlandsetaal/galahad-taggers-stanza:$VERSION stanza
39+
40+
# Huggingface
41+
# TODO

buildall.sh

Lines changed: 0 additions & 35 deletions
This file was deleted.

buildandpushall.sh

Lines changed: 0 additions & 32 deletions
This file was deleted.

0 commit comments

Comments
 (0)