[scripts] script to fetch crepe model from upstream repo
authorPaul Brossier <piem@piem.org>
Tue, 8 Jan 2019 15:40:03 +0000 (16:40 +0100)
committerPaul Brossier <piem@piem.org>
Wed, 29 Dec 2021 16:51:57 +0000 (11:51 -0500)
scripts/get_crepe.sh [new file with mode: 0755]

diff --git a/scripts/get_crepe.sh b/scripts/get_crepe.sh
new file mode 100755 (executable)
index 0000000..4671cfb
--- /dev/null
@@ -0,0 +1,16 @@
+#! /bin/bash
+
+CREPEURL=https://github.com/marl/crepe/blob/models/model-tiny.h5.bz2?raw=true
+MODELTARGET=crepe-model-tiny.h5
+SHA512=91df10316092de0d9c35ae0eaa8f6cceb49fb01f54dc74f9f1196f7f569a3f885242d1abded56c9825180552a602d9e76f2021d7cfb55cfbefb2f84c8a9f4715
+
+
+function checkmodelsum () {
+  (echo $SHA512  $MODELTARGET | sha512sum -c - ) || (echo $MODELTARGET checksum did not match?!; exit 1)
+}
+
+function fetchmodel () {
+  wget -qO- $CREPEURL | bunzip2 - > $MODELTARGET
+}
+
+( [ -f "$MODELTARGET" ] || fetchmodel ) && checkmodelsum