File size: 2,352 Bytes
e4beea4
7197abd
e4beea4
 
 
 
 
 
 
 
944afcd
 
 
 
 
 
 
e4beea4
 
 
 
944afcd
 
 
e4beea4
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
944afcd
e4beea4
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#!/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.'"