diff options
author | Roman Grundkiewicz <rgrundkiewicz@gmail.com> | 2022-02-23 16:29:33 +0300 |
---|---|---|
committer | Roman Grundkiewicz <rgrundkiewicz@gmail.com> | 2022-02-23 16:29:33 +0300 |
commit | 02a02001c118a829d13fbdf7f94c86ae5966caad (patch) | |
tree | bd675a57b2a35730b51013c5f5086c82de2d1ffd | |
parent | 58048b90d7caacfd4feabe4ff05a9ea6b4c79205 (diff) |
Download models using azcopy if possiblemaster-updates
-rw-r--r-- | models/download-models.sh | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/models/download-models.sh b/models/download-models.sh index 88432c1..f3a7199 100644 --- a/models/download-models.sh +++ b/models/download-models.sh @@ -27,6 +27,12 @@ MODEL_TARBALLS=( #char-s2s # A character-level RNN model (obsolete) ) +AZCOPY=true +if ! command -v azcopy &> /dev/null; then + echo "Warning: 'azcopy' is not installed in your system. Downloading with 'wget'." + AZCOPY=false +fi + if [ $# -gt 0 ]; then echo The list of parameters is not empty. echo Skipping models not in the list: $* @@ -43,7 +49,11 @@ for model in ${MODEL_TARBALLS[@]}; do fi echo Downloading checksum for $file ... - wget -nv -O- $URL/$file.md5 > $model.md5.newest + if $AZCOPY; then + azcopy copy "$URL/$file.md5" $model.md5.newest + else + wget -nv -O- $URL/$file.md5 > $model.md5.newest + fi # Do not download if the checksum files are identical, i.e. the archive has # not been updated since it was downloaded last time @@ -51,7 +61,11 @@ for model in ${MODEL_TARBALLS[@]}; do echo File $file does not need to be updated else echo Downloading $file ... - wget -nv $URL/$file + if $AZCOPY; then + azcopy copy "$URL/$file" . + else + wget -nv $URL/$file + fi # Extract the archive tar zxf $file # Remove archive to save disk space |