1
1
mirror of https://github.com/MarginaliaSearch/MarginaliaSearch.git synced 2025-10-05 21:22:39 +02:00

Merge pull request #64 from dreimolo/macos_AS_fix

Macos apple silicon fix, and slight improvements to sample downloader
This commit is contained in:
Viktor
2023-12-18 18:29:14 +01:00
committed by GitHub
3 changed files with 33 additions and 5 deletions

View File

@@ -2,6 +2,25 @@
set -e
# Check if wget exists
if command -v wget &> /dev/null; then
dl_prg="wget -O"
elif command -v curl &> /dev/null; then
dl_prg="curl -o"
else
echo "Neither wget nor curl found, exiting .."
exit 1
fi
case "$1" in
"s"|"m"|"l"|"xl")
;;
*)
echo "Invalid argument. Must be one of 's', 'm', 'l' or 'xl'."
exit 1
;;
esac
SAMPLE_NAME=crawl-${1:-m}
SAMPLE_DIR="node-1/samples/${SAMPLE_NAME}/"
@@ -11,7 +30,7 @@ function download_model {
if [ ! -f $model ]; then
echo "** Downloading $url"
wget -O $model $url
$dl_prg $model $url
fi
}
@@ -23,7 +42,7 @@ fi
mkdir -p node-1/samples/
SAMPLE_TARBALL=samples/${SAMPLE_NAME}.tar.gz
download_model ${SAMPLE_TARBALL} https://downloads.marginalia.nu/${SAMPLE_TARBALL} || rm ${SAMPLE_TARBALL}
download_model ${SAMPLE_TARBALL}.tmp https://downloads.marginalia.nu/${SAMPLE_TARBALL} && mv ${SAMPLE_TARBALL}.tmp ${SAMPLE_TARBALL}
if [ ! -f ${SAMPLE_TARBALL} ]; then
echo "!! Failed"

View File

@@ -12,7 +12,8 @@ function download_model {
if [ ! -f $model ]; then
echo "** Downloading $url"
curl -s -o $model $url
curl -s -o $model.tmp $url
mv $model.tmp $model
fi
}