Skip to content

Instantly share code, notes, and snippets.

@bricksdont
Created September 2, 2020 14:48
Show Gist options
  • Select an option

  • Save bricksdont/58dfa0964201c83961a30f23406baa5d to your computer and use it in GitHub Desktop.

Select an option

Save bricksdont/58dfa0964201c83961a30f23406baa5d to your computer and use it in GitHub Desktop.
#! /bin/bash
# change base path before running this
base=/net/cephfs/scratch/mathmu/map-volatility/debug/complete
# install
virtualenv -p python3 $base/venvs/sockeye3
source $base/venvs/sockeye3/bin/activate
# CUDA version on instance
CUDA_VERSION=102
wget https://raw.githubusercontent.com/awslabs/sockeye/master/requirements/requirements.gpu-cu${CUDA_VERSION}.txt
sed -i 's/mxnet-cu102mkl==1.6.0/mxnet-cu102mkl==1.6.0.post0/g' requirements.gpu-cu${CUDA_VERSION}.txt
pip install sockeye --no-deps -r requirements.gpu-cu${CUDA_VERSION}.txt
rm requirements.gpu-cu${CUDA_VERSION}.txt
pip install matplotlib mxboard
pip install requests
# download model and data
wget https://files.ifi.uzh.ch/cl/archiv/2020/clcontra/bel-eng.baseline.tar.gz
tar -xzvf bel-eng.baseline.tar.gz
# sample
OMP_NUM_THREADS=1 python -m sockeye.translate \
-i $base/bel-eng.baseline/dev.pieces.src \
-o $base/output \
-m $base/bel-eng.baseline \
--sample \
--seed 17 \
--length-penalty-alpha 1.0 \
--device-ids 0 \
--batch-size 64 \
--disable-device-locking
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment