-
-
Notifications
You must be signed in to change notification settings - Fork 13
/
install_gce.sh
29 lines (23 loc) · 692 Bytes
/
install_gce.sh
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
#!/bin/bash
# Gather CTRL and copy to working directory
git clone https://github.com/salesforce/ctrl.git
mv ctrl/* .
# Cython is needed to compile fastBPE
sudo pip install Cython
# Patch the TensorFlow estimator package
FILE="/usr/local/lib/python2.7/dist-packages/tensorflow_estimator/python/estimator/keras.py"
sudo patch -b "$FILE" estimator.patch
# Install fastBPE
git clone https://github.com/glample/fastBPE.git
cd fastBPE
sudo python setup.py install
cd ..
# Download the 512-length model if specified, 256-length otherwise
if [ "$1" = "512" ]
then
URL="gs://sf-ctrl/seqlen512_v1.ckpt/"
else
URL="gs://sf-ctrl/seqlen256_v1.ckpt/"
fi
# Copy model
gsutil -m cp -r "$URL" .