Skip to content

Commit dfd4175

Browse files
author
Jan Buethe
committed
updates in download_model.sh (more verbose now)
1 parent 9faf6f0 commit dfd4175

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

dnn/download_model.sh

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,22 +8,21 @@ if [ ! -f $model ]; then
88
wget https://media.xiph.org/opus/models/$model
99
fi
1010

11-
SHA256=$(command -v sha256sum)
12-
if [ "$?" != "0" ]
11+
if command -v sha256sum
1312
then
14-
echo "Could not find sha256 sum. Skipping verification. Please verify manually that sha256 hash of ${model} matches ${1}."
15-
else
1613
echo "Validating checksum"
17-
checksum=$1
14+
checksum="$1"
1815
checksum2=$(sha256sum $model | awk '{print $1}')
1916
if [ "$checksum" != "$checksum2" ]
2017
then
21-
echo "checksums don't match, aborting"
18+
echo "Aborting due to mismatching checksums. This could be caused by a corrupted download of $model."
19+
echo "Consider deleting local copy of $model and running this script again."
2220
exit 1
2321
else
2422
echo "checksums match"
2523
fi
26-
24+
else
25+
echo "Could not find sha256 sum; skipping verification. Please verify manually that sha256 hash of ${model} matches ${1}."
2726
fi
2827

2928

0 commit comments

Comments
 (0)