-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathfetch_models.sh
executable file
·65 lines (53 loc) · 2.47 KB
/
fetch_models.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
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
#!/usr/bin/env bash
if [[ $# != 1 ]] || { [[ $1 != "test" ]] && [[ $1 != "dep" ]]; }; then
echo "Please provide a single argument: \"test\" or \"dep\""
exit 1
fi
echo "Fetching $1 models..."
if [[ $1 == "test" ]]; then
mkdir -p models
else
mkdir -p /models/
fi
STORAGE_ROOT="https://storage.googleapis.com/tiro-is-public-assets/models"
dl() {
set -x
mkdir -p $(dirname $2)
curl "$1" -o "$2"
set +x
}
ALFUR_FASTSPEECH_ORIGIN="$STORAGE_ROOT/tts/fastspeech2/v2021-01-01/checkpoint_490000_jit_quant_fbgemm_v2.pt"
ALFUR_MELGAN_ORIGIN="$STORAGE_ROOT/tts/fastspeech2/v2021-01-01/vocoder_aca5990_3350_jit_v2.pt"
DILJA_FASTSPEECH_ORIGIN="$STORAGE_ROOT/tts/fastspeech2/dilja/v2021-07-26/checkpoint_380000_jit_quant_fbgemm_v2.pt"
DILJA_MELGAN_ORIGIN="$STORAGE_ROOT/tts/fastspeech2/dilja/v2021-07-26/dilja_aca5990_4550_jit_v2.pt"
LEXICON_ORIGIN="$STORAGE_ROOT/g2p/iceprondict/version_21.06/ice_pron_dict_standard_clear.csv"
ALFUR_ESPNET2_ORIGIN="$STORAGE_ROOT/tts/espnet2/alfur/f_tts_train_fastspeech2_raw_phn_none_train.loss.ave.zip"
DILJA_ESPNET2_ORIGIN="$STORAGE_ROOT/tts/espnet2/dilja/c_tts_train_fastspeech2_raw_phn_none_train.loss.ave.zip"
MBMELGAN_ORIGIN="$STORAGE_ROOT/tts/espnet2/universal/mbmelgan.zip"
ALFUR_FASTSPEECH_DESTINATION="/models/alfur/fastspeech_jit.pt"
ALFUR_MELGAN_DESTINATION="/models/alfur/melgan_jit.pt"
DILJA_FASTSPEECH_DESTINATION="/models/dilja/fastspeech_jit.pt"
DILJA_MELGAN_DESTINATION="/models/dilja/melgan_jit.pt"
LEXICON_DESTINATION="/models/lexicon.txt"
ALFUR_ESPNET2_DESTINATION="/models/alfur/espnet2.zip"
DILJA_ESPNET2_DESTINATION="/models/dilja/espnet2.zip"
MBMELGAN_DESTINATION="/models/universal/mbmelgan.zip"
if [[ $1 == "test" ]]; then
LEXICON_DESTINATION=${LEXICON_DESTINATION:1}
ALFUR_MELGAN_DESTINATION=${ALFUR_MELGAN_DESTINATION:1}
ALFUR_FASTSPEECH_DESTINATION=${ALFUR_FASTSPEECH_DESTINATION:1}
ALFUR_ESPNET2_DESTINATION=${ALFUR_ESPNET2_DESTINATION:1}
DILJA_ESPNET2_DESTINATION=${DILJA_ESPNET2_DESTINATION:1}
MBMELGAN_DESTINATION=${MBMELGAN_DESTINATION:1}
fi
if [[ $1 == "dep" ]]; then
dl $DILJA_FASTSPEECH_ORIGIN $DILJA_FASTSPEECH_DESTINATION
dl $DILJA_MELGAN_ORIGIN $DILJA_MELGAN_DESTINATION
fi
dl $ALFUR_FASTSPEECH_ORIGIN $ALFUR_FASTSPEECH_DESTINATION
dl $ALFUR_MELGAN_ORIGIN $ALFUR_MELGAN_DESTINATION
dl $LEXICON_ORIGIN $LEXICON_DESTINATION
dl $ALFUR_ESPNET2_ORIGIN $ALFUR_ESPNET2_DESTINATION
dl $DILJA_ESPNET2_ORIGIN $DILJA_ESPNET2_DESTINATION
dl $MBMELGAN_ORIGIN $MBMELGAN_DESTINATION
echo "Successfully finished fetching $1 models!"