Let --data-path be specified when running download.py scripts #642
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Adds a
--data-path
(or-d
) argument to the download.py scripts that lets the path to download to be specified.Motivation and Context
Makes downloading to a custom location easier; resolves #637
How Has This Been Tested?
Manually. After
pip install -e .
, I did agit clean -xdf
to clean my local repo, then, in sequence:Checked that
gives the empty string
Ran
python3 -m spacy.en.download all -d ~/some_dir
Checked that
spacy.load('en')('Hello, world')[0].pos_
still gave the empty string but thatspacy.util.set_data_path('/home/mark/some_dir'); spacy.load('en')('Hello, world')[0].pos_
didn't.Ran
python3 -m spacy.en.download all
Checked that
spacy.load('en')('Hello, world')[0].pos_
no longer gave the empty string.Tried running
python3 -m spacy.en.download all
andpython3 -m spacy.en.download all -d ~/some_dir
again and confirmed that both exited early saying that the model was already installed.Types of changes
Checklist: