-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprepare_environment.sh
More file actions
32 lines (26 loc) · 1.23 KB
/
prepare_environment.sh
File metadata and controls
32 lines (26 loc) · 1.23 KB
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
#!/bin/bash
mkdir -p actual_models
cd actual_models || exit
READY_MODELS_FILE=ready_models_file.txt
#This check if the ready_models_file.txt is present, so the models are already downloaded, and check if the user doesn't force the re-download
if [ "$1" = "true" ] ; then
rm $READY_MODELS_FILE
fi
if ! test -f "$READY_MODELS_FILE"; then
FILEID="14wfQxnocjzHdRy2cav7QB9HA_aroJtcz"
FILENAME="bert-model.zip"
mkdir tmp
touch tmp/cookies.txt
wget --load-cookies tmp/cookies.txt "https://docs.google.com/uc?export=download&confirm=$(wget --quiet --save-cookies tmp/cookies.txt --keep-session-cookies --no-check-certificate 'https://docs.google.com/uc?export=download&id='$FILEID -O- | sed -rn 's/.*confirm=([0-9A-Za-z_]+).*/\1\n/p')&id="$FILEID -O $FILENAME || exit
rm -r tmp
unzip -o $FILENAME || exit
git clone https://github.com/chiayewken/bert-qa || exit
mkdir -p squad_dir
cd squad_dir || exit
wget https://rajpurkar.github.io/SQuAD-explorer/dataset/dev-v1.1.json || exit
wget https://raw.githubusercontent.com/allenai/bi-att-flow/master/squad/evaluate-v1.1.py || exit
wget https://rajpurkar.github.io/SQuAD-explorer/dataset/train-v1.1.json || exit
cd ..
touch $READY_MODELS_FILE
echo "true" > $READY_MODELS_FILE
fi