Files
AI-Profile-Router/experiments/ornith15-ab/prepare.sh
T

27 lines
1.2 KiB
Bash
Executable File

#!/usr/bin/env bash
set -Eeuo pipefail
cd "$(dirname "$0")"
MODEL_DIR=/data/models/ornith15-ab
REVISION=12393612fd4f730ff5aadc23e9b8f9648aa49ceb
FILE=Ornith-1.5-35B-Q4_K_M.gguf
SHA256=42739874cc2ccfdb8523b23fbe52e29b2a7555c8176737ca9ca0b5d59859d41f
PROJECTOR=mmproj-Ornith-1.5-35B-BF16.gguf
PROJECTOR_SHA256=1921a36a85aee56cd2abd27f46701802c9d85a33474792e600df6c3b282a135d
BASE=https://huggingface.co/ornith-ai/Ornith-1.5-35B-A3B-GGUF/resolve/$REVISION
test "$(hostname)" = athena || { echo 'Run on Athena only' >&2; exit 2; }
install -d -m 0755 "$MODEL_DIR"
fetch() {
local file=$1 hash=$2
if ! (cd "$MODEL_DIR" && printf '%s %s\n' "$hash" "$file" | sha256sum -c --status); then
curl --fail --location --retry 8 --retry-all-errors --continue-at - \
--output "$MODEL_DIR/$file.part" "$BASE/$file"
(cd "$MODEL_DIR" && printf '%s %s\n' "$hash" "$file.part" | sha256sum -c)
mv "$MODEL_DIR/$file.part" "$MODEL_DIR/$file"
fi
}
fetch "$FILE" "$SHA256"
fetch "$PROJECTOR" "$PROJECTOR_SHA256"
./case.sh fast create
test "$(docker inspect -f '{{.State.Status}}' mike-ai-ornith15-ab)" = created
echo 'Ornith 1.5 is prepared; test container is stopped. No inference was run.'