From a0c4b29dcbacfa784e7522653e18ca6c78084419 Mon Sep 17 00:00:00 2001 From: Mark Amery Date: Sun, 20 Nov 2016 16:52:56 +0000 Subject: [PATCH] Document new --data-path argument --- README.rst | 16 ++++++++++++++++ website/docs/usage/index.jade | 17 +++++++++++++++++ 2 files changed, 33 insertions(+) diff --git a/README.rst b/README.rst index e1432463b..bac46dec4 100644 --- a/README.rst +++ b/README.rst @@ -222,6 +222,22 @@ and ``--model`` are optional and enable additional tests: python -m pytest --vectors --model --slow +Download model to custom location +================================= + +You can specify where ``spacy.en.download`` and ``spacy.de.download`` download the language model +to using the ``--data-path`` or ``-d`` argument: + +.. code:: bash + + python -m spacy.en.download all --data-path /some/dir + + +If you choose to download to a custom location, you will need to tell spaCy where to load the model +from in order to use it. You can do this either by calling ``spacy.util.set_data_path()`` before +calling ``spacy.load()``, or by passing a ``path`` argument to the ``spacy.en.English`` or +``spacy.de.German`` constructors. + Changelog ========= diff --git a/website/docs/usage/index.jade b/website/docs/usage/index.jade index a4bb29d06..384a7d203 100644 --- a/website/docs/usage/index.jade +++ b/website/docs/usage/index.jade @@ -114,3 +114,20 @@ p python -m pip install -U pytest python -m pytest <spacy-directory> --vectors --model --slow + ++h(2, "custom-location") Download model to custom location + +p + | You can specify where #[code spacy.en.download] and + | #[code spacy.de.download] download the language model to using the + | #[code --data-path] or #[code -d] argument: + ++code(false, "bash"). + python -m spacy.en.download all --data-path /some/dir + +p + | If you choose to download to a custom location, you will need to tell + | spaCy where to load the model from in order to use it. You can do this + | either by calling #[code spacy.util.set_data_path()] before calling + | #[code spacy.load()], or by passing a #[code path] argument to the + | #[code spacy.en.English] or #[code spacy.de.German] constructors.