-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
79 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
ARG REPOSITORY="docker.io" | ||
FROM dedocproject/dedoc_p3.9_base:version_2023_08_28 | ||
|
||
ENV PYTHONPATH "${PYTHONPATH}:/dedoc_root" | ||
ENV RESOURCES_PATH "/dedoc_root/resources" | ||
|
||
ADD requirements.txt . | ||
RUN pip3 install --no-cache-dir -r requirements.txt | ||
RUN pip install torch==1.11.0+cu113 torchvision==0.12.0+cu113 -f https://download.pytorch.org/whl/torch_stable.html | ||
|
||
RUN mkdir /dedoc_root | ||
RUN mkdir /dedoc_root/dedoc | ||
ADD dedoc/config.py /dedoc_root/dedoc/config.py | ||
ADD dedoc/download_models.py /dedoc_root/dedoc/download_models.py | ||
RUN python3 /dedoc_root/dedoc/download_models.py | ||
|
||
ADD dedoc /dedoc_root/dedoc | ||
ADD VERSION /dedoc_root | ||
RUN echo "__version__ = \"$(cat /dedoc_root/VERSION)\"" > /dedoc_root/dedoc/version.py | ||
|
||
ADD tests /dedoc_root/tests | ||
ADD resources /dedoc_root/resources | ||
|
||
CMD ["python3", "/dedoc_root/dedoc/main.py", "-c", "/dedoc_root/dedoc/config.py"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
To run Dedoc on CUDA with Docker use files from `docker_gpu` directory | ||
([CUDA Container Toolkit](https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/install-guide.html) | ||
should be installed on your machine): | ||
|
||
1. Set `on_gpu` to `True` in `config.py` | ||
2. Run application: | ||
```shell | ||
cd docker_gpu | ||
docker-compose up --build | ||
``` | ||
|
||
You can change index of CUDA device at `docker-compose.yml`: | ||
``` | ||
NVIDIA_VISIBLE_DEVICES: 0 | ||
NVIDIA_VISIBLE_DEVICES: 0, 3 | ||
NVIDIA_VISIBLE_DEVICES: all | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
version: '2.4' | ||
|
||
services: | ||
dedoc: | ||
mem_limit: 16G | ||
build: | ||
context: .. | ||
dockerfile: docker_gpu/Dockerfile | ||
restart: always | ||
tty: true | ||
ports: | ||
- 1231:1231 | ||
environment: | ||
DOCREADER_PORT: 1231 | ||
NVIDIA_VISIBLE_DEVICES: 0 | ||
runtime: nvidia | ||
|
||
test: | ||
depends_on: | ||
- dedoc | ||
build: | ||
context: .. | ||
dockerfile: docker_gpu/Dockerfile | ||
tty: true | ||
environment: | ||
DOC_READER_HOST: "dedoc" | ||
DOCREADER_PORT: 1231 | ||
is_test: $test | ||
PYTHONPATH: $PYTHONPATH:/dedoc_root/tests:/dedoc_root | ||
NVIDIA_VISIBLE_DEVICES: 0 | ||
runtime: nvidia | ||
command: | ||
bash dedoc_root/tests/run_tests_in_docker.sh |