|
a |
|
b/pretrained_models/download_model.sh |
|
|
1 |
#!/bin/bash |
|
|
2 |
echo "Note: available models are carson_Jan2021, carmen_Jan2021" |
|
|
3 |
echo "Downloading weights from the Harvard Dataverse: https://doi.org/10.7910/DVN/XB6PEZ" |
|
|
4 |
|
|
|
5 |
# Define the URLs of the files to download |
|
|
6 |
url1="https://dataverse.harvard.edu/api/access/datafile/10358815" |
|
|
7 |
url2="https://dataverse.harvard.edu/api/access/datafile/10358816" |
|
|
8 |
|
|
|
9 |
# Define the directory to save the files |
|
|
10 |
MODEL_DIR="./pretrained_models" |
|
|
11 |
|
|
|
12 |
# Define the filenames |
|
|
13 |
filename1="carmen_Jan2021.h5" |
|
|
14 |
filename2="carson_Jan2021.h5" |
|
|
15 |
|
|
|
16 |
# Create the directory if it doesn't exist |
|
|
17 |
mkdir -p "$MODEL_DIR" |
|
|
18 |
|
|
|
19 |
# Function to download a file |
|
|
20 |
download_file() { |
|
|
21 |
local url=$1 |
|
|
22 |
local filename=$2 |
|
|
23 |
curl -L -o "$MODEL_DIR/$filename" "$url" |
|
|
24 |
|
|
|
25 |
# Check if the download was successful |
|
|
26 |
if [ $? -eq 0 ]; then |
|
|
27 |
echo "Download of $filename completed successfully. Saved to $MODEL_DIR/$filename" |
|
|
28 |
else |
|
|
29 |
echo "Download of $filename failed." |
|
|
30 |
exit 1 |
|
|
31 |
fi |
|
|
32 |
} |
|
|
33 |
|
|
|
34 |
# Download the files |
|
|
35 |
download_file "$url1" "$filename1" |
|
|
36 |
download_file "$url2" "$filename2" |
|
|
37 |
|