Skip to content
This repository has been archived by the owner on Dec 16, 2022. It is now read-only.

Commit

Permalink
add missing nltk download in CI (#5529)
Browse files Browse the repository at this point in the history
* add missing nltk download in CI

* fix

* fix

* fix docker run

* upgrade cached-path for bug fix
  • Loading branch information
epwalsh authored Dec 23, 2021
1 parent ab4f7b5 commit ec1fb69
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 3 deletions.
12 changes: 11 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,8 @@ jobs:
python: ['3.7', '3.8', '3.9']

steps:
- uses: actions/checkout@v2

- name: Setup Python
uses: actions/setup-python@v2
with:
Expand All @@ -369,6 +371,14 @@ jobs:
run: |
pip install $(ls dist/*.whl)
- name: Download NLTK prerequisites
run: |
make download-extras
- name: Cleanup workspace
run: |
rm -rf allennlp/ setup.py tests/ test_fixtures/
- name: Pip freeze
run: |
pip freeze
Expand Down Expand Up @@ -407,7 +417,7 @@ jobs:
- name: Test image
run: |
make docker-run DOCKER_GPUS='' DOCKER_IMAGE_NAME=$DOCKER_IMAGE_NAME ARGS='test-install'
docker run --rm $DOCKER_IMAGE_NAME test-install
- name: Authenticate to Docker Hub
if: github.event_name == 'release' || github.event_name == 'push'
Expand Down
3 changes: 3 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ RUN touch allennlp/__init__.py \
COPY allennlp allennlp
RUN pip install --no-cache-dir --no-deps -e .

COPY Makefile .
RUN make download-extras

WORKDIR /app/

# Copy wrapper script to allow beaker to run resumable training workloads.
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ DOCKER_RUN_CMD = docker run --rm \
# These nltk packages are used by the 'checklist' module. They are downloaded automatically
# if not found when `checklist` is imported, but it's good to download the ahead of time
# to avoid potential race conditions.
NLTK_DOWNLOAD_CMD = python -c 'import nltk; [nltk.download(p) for p in ("wordnet", "wordnet_ic", "sentiwordnet")]'
NLTK_DOWNLOAD_CMD = python -c 'import nltk; [nltk.download(p) for p in ("wordnet", "wordnet_ic", "sentiwordnet", "omw-1.4")]'

ifeq ($(shell uname),Darwin)
ifeq ($(shell which gsed),)
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
install_requires=[
"torch>=1.6.0,<1.11.0",
"torchvision>=0.8.1,<0.12.0",
"cached-path>=1.0.0,<2.0.0",
"cached-path>=1.0.2,<2.0.0",
"fairscale==0.4.3",
"jsonnet>=0.10.0 ; sys.platform != 'win32'",
"nltk",
Expand Down

0 comments on commit ec1fb69

Please sign in to comment.