The recommended setup is described below. Modifications to this setup will be called out as appropriate.
It is highly recommended that a conda environment is used to house your PyTorch installation. This has the benefit of insulating against vesion differences. Alternatives to using conda for installation can be found on pytorch.org.
# Create the environment
conda create --name nlpbook
source activate nlpbook
Note, this installs the GPU versions as of January, 2019. If this command changes in the future, this README will be updated accordingly. If it is not, please file an issue.
conda install pytorch torchvision -c pytorch
If you need the CPU versions, want to use pip install of conda, or a host of other configuration variations, please consult the website. They have done a great job of making it easy to retrieve the correct install command.
You can download the repository from this URL using git or downloading the repository as a zip file. As of January, 2019, this URL redirects to https://github.com/joosthub/PyTorchNLPBook and you can use the following commands to clone the repository:
git clone [email protected]:joosthub/PyTorchNLPBook.git
Or
git clone https://github.com/joosthub/PyTorchNLPBook.git
Inside the repository is a requirements file which can be used to install the remaining packages.
cd PyTorchNLPBook
pip install -r requirements.txt
python -m ipykernel install --user --name nlpbook
cd data
./get-all-data.sh
Note: GloVe is not bundled in our data downloader. See data/README.md
for more information.
# run from the top level. if running commands in order, will need to `cd ..`
jupyter notebook