1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81
|
#!/bin/bash
# This script is meant to be called by the "install" step defined in
# .travis.yml. See http://docs.travis-ci.com/ for more details.
# The behavior of the script is controlled by environment variabled defined
# in the .travis.yml in the top level folder of the project.
set -e
echo 'List files from cached directories'
if [ -d $HOME/download ]; then
echo 'download:'
ls $HOME/download
fi
if [ -d $HOME/.cache/pip ]; then
echo 'pip:'
ls $HOME/.cache/pip
fi
# Deactivate the travis-provided virtual environment and setup a
# conda-based environment instead
deactivate
# Add the miniconda bin directory to $PATH
export PATH=/home/travis/miniconda3/bin:$PATH
echo $PATH
# Use the miniconda installer for setup of conda itself
pushd .
cd
mkdir -p download
cd download
if [[ ! -f /home/travis/miniconda3/bin/activate ]]
then
if [[ ! -f miniconda.sh ]]
then
wget http://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh \
-O miniconda.sh
fi
chmod +x miniconda.sh && ./miniconda.sh -b -f
conda update --yes conda
echo "Creating environment to run tests in."
conda create -n testenv --yes python="$PYTHON_VERSION"
fi
cd ..
popd
# Activate the python environment we created.
source activate testenv
# Install requirements via pip in our conda environment
conda install -y pytorch cpuonly -c pytorch-nightly
pip install -r requirements.txt
# Install the following only if running tests
if [[ "$SKIP_INSTALL" != "true" ]]; then
# TorchAudio CPP Extensions
python setup.py install
fi
if [[ "$RUN_EXAMPLE_TESTS" == "true" ]]; then
# Install dependencies
pip install sentencepiece PyAudio
if [[ ! -d $HOME/download/fairseq ]]; then
# Install fairseq from source
git clone https://github.com/pytorch/fairseq $HOME/download/fairseq
fi
pushd $HOME/download/fairseq
pip install --editable .
popd
mkdir -p $HOME/download/data
# Install dictionary, sentence piece model, and model
# These are cached so they are not downloaded if they already exist
wget -nc -O $HOME/download/data/dict.txt https://download.pytorch.org/models/audio/dict.txt || true
wget -nc -O $HOME/download/data/spm.model https://download.pytorch.org/models/audio/spm.model || true
wget -nc -O $HOME/download/data/model.pt https://download.pytorch.org/models/audio/checkpoint_avg_60_80.pt || true
fi
echo "Finished installation"
|