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

Commit

Permalink
ensure 'from_files' vocab doesn't load instances (#4356)
Browse files Browse the repository at this point in the history
* ensure 'from_files' vocab doesn't load instances

* clean up

* consolidate CUDA check in CI
  • Loading branch information
epwalsh committed Jun 14, 2020
1 parent 87c23e4 commit 6a124d8
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 10 deletions.
4 changes: 0 additions & 4 deletions .github/workflows/master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,6 @@ jobs:
run: |
make docker-test-image DOCKER_TAG=$DOCKER_TAG
- name: Ensure CUDA available
run: |
make docker-test-run DOCKER_TAG=$DOCKER_TAG ARGS='check-for-cuda'
- name: Run GPU tests
run: |
make docker-test-run DOCKER_TAG=$DOCKER_TAG ARGS='gpu-test'
Expand Down
4 changes: 0 additions & 4 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,6 @@ jobs:
run: |
make docker-test-image DOCKER_TAG=$DOCKER_TAG
- name: Ensure CUDA available
run: |
make docker-test-run DOCKER_TAG=$DOCKER_TAG ARGS='check-for-cuda'
- name: Run GPU tests
run: |
make docker-test-run DOCKER_TAG=$DOCKER_TAG ARGS='gpu-test'
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ test-with-cov :
--cov-report=xml

.PHONY : gpu-test
gpu-test :
gpu-test : check-for-cuda
pytest --color=yes -v -rf -m gpu

.PHONY : benchmarks
Expand Down
2 changes: 1 addition & 1 deletion allennlp/training/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@ def make_vocab_from_params(
)
# Do a quick sanity check here. There's no need to load any datasets if the vocab
# type is "empty".
if datasets_for_vocab_creation is None and vocab_params.get("type") == "empty":
if datasets_for_vocab_creation is None and vocab_params.get("type") in ("empty", "from_files"):
datasets_for_vocab_creation = []

datasets: Dict[str, Dataset]
Expand Down

0 comments on commit 6a124d8

Please sign in to comment.