#!/bin/bash set -euo pipefail KING="Ingot-XIV-27B-Q2" PREV="Ingot-XIII-27B-Q2" mkdir -p /root/models/king/current echo "king: $KING prev: $PREV" [ -s /root/models/king/cur.gguf ] || curl -sL -o /root/models/king/cur.gguf \ "https://huggingface.co/dendriteholdings/$KING/resolve/main/$KING-PQ2_0.gguf" cp -n /root/models/king/cur.gguf "/root/models/king/current/$KING-PQ2_0.gguf" || true [ -s /root/models/king/prev.gguf ] || curl -sL -o /root/models/king/prev.gguf \ "https://huggingface.co/dendriteholdings/$PREV/resolve/main/$PREV-PQ2_0.gguf" for f in LICENSE NOTICE.txt; do [ -s "/root/models/king/current/$f" ] || curl -sL -o "/root/models/king/current/$f" \ "https://huggingface.co/dendriteholdings/$KING/resolve/main/$f" done sed -i \ -e "s|sd\[name\] = ck.get(name)$|sd[name] = ck.get(name).to(torch.bfloat16)|" \ -e 's|device_map="cpu"|device_map={"": "cuda"}|' \ -e 's|torch.save(out, "/dev/shm/king_hf.pt")|torch.save(out, "/root/king_hf.pt")|' \ -e 's|print("saved /dev/shm/king_hf.pt")|print("saved /root/king_hf.pt")|' \ /root/build_king_hf.py sed -i "s|GGUF_DIR = .*|GGUF_DIR = \"/root/models/king\"|" /root/build_king_hf.py [ -s /root/king_hf.pt ] || /root/ingot/.venv/bin/python /root/build_king_hf.py cd /root/ingot .venv/bin/python /root/fn_test.py .venv/bin/python /root/transform_check.py echo "SETUP COMPLETE — all smokes green"