Thanatos-27B-HERETIC / scripts /fetch_vision.sh
FoolDev's picture
Swap base model: Qwen/Qwen3.6-27B → llmfan46 Heretic v2 (uncensored)
944afcd
Raw
History Blame Contribute Delete
2.35 kB
#!/usr/bin/env bash
# Thanatos-27B — fetch the vision projector (mmproj) for image input.
#
# Why this is separate from build.sh:
# build.sh is for the Ollama text path. The mmproj is only useful for
# llama.cpp / llama-cpp-python right now, because Ollama's vendored
# llama.cpp fork is missing the qwen35 arch entries needed to attach
# it (see README Vision section, ollama/ollama#15898).
#
# Usage:
# ./scripts/fetch_vision.sh # default: BF16 (~931 MB)
#
# llmfan46/Qwen3.6-27B-uncensored-heretic-v2-GGUF publishes BF16 only;
# for F16/F32 variants fall back to unsloth's reference projector:
# REPO_ID=unsloth/Qwen3.6-27B-GGUF FILE_NAME=mmproj-F16.gguf ./scripts/fetch_vision.sh
# (vision tokens are projected the same way across Qwen 3.6 27B
# finetunes, so the unsloth projector is functionally interchangeable.)
#
# Requires: huggingface-cli (or hf).
set -euo pipefail
PRECISION="${1:-${PRECISION:-BF16}}"
REPO_ID="${REPO_ID:-llmfan46/Qwen3.6-27B-uncensored-heretic-v2-GGUF}"
FILE_NAME="${FILE_NAME:-Qwen3.6-27B-mmproj-${PRECISION}.gguf}"
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
DEST="${MMPROJ_PATH:-${ROOT}/${FILE_NAME}}"
echo "[*] repo: ${REPO_ID}"
echo "[*] precision: ${PRECISION}"
echo "[*] file: ${FILE_NAME}"
echo "[*] dest: ${DEST}"
if [[ -f "${DEST}" ]]; then
echo "[=] already present at ${DEST}, skipping."
exit 0
fi
HF=""
if command -v hf >/dev/null 2>&1; then
HF="hf"
elif command -v huggingface-cli >/dev/null 2>&1; then
HF="huggingface-cli"
else
echo "[!] Neither 'hf' nor 'huggingface-cli' found." >&2
echo " pip install -U huggingface_hub" >&2
exit 1
fi
DEST_DIR="$(dirname "${DEST}")"
mkdir -p "${DEST_DIR}"
case "${HF}" in
hf) hf download "${REPO_ID}" "${FILE_NAME}" --local-dir "${DEST_DIR}" ;;
huggingface-cli) huggingface-cli download "${REPO_ID}" "${FILE_NAME}" --local-dir "${DEST_DIR}" ;;
esac
if [[ ! -f "${DEST}" ]]; then
echo "[!] download failed: ${DEST} not present." >&2
exit 1
fi
echo
echo "[+] Done. Use it via:"
echo " python ${ROOT}/examples/llama_cpp_vision.py \\"
echo " --gguf /path/to/Qwen3.6-27B-uncensored-heretic-v2-Q4_K_M.gguf \\"
echo " --mmproj ${DEST} \\"
echo " --image /path/to/photo.jpg \\"
echo " --prompt 'Describe this image.'"