BladeSzaSza's picture
fix: define REPO_NAME in hf_upload.sh (ensure_blade_space referenced it)
4948993 verified
Raw
History Blame Contribute Delete
1.35 kB
#!/usr/bin/env bash
# Launch llama-server with the FormScout Judge/Classifier VLM.
#
# Default model: Qwen3-VL-8B-Instruct Q4_K_M (checkpoints/qwen3-vl/).
# To serve a fine-tuned GGUF instead, set:
# FORMSCOUT_JUDGE_GGUF=/path/to/finetuned.gguf
# FORMSCOUT_JUDGE_MMPROJ=/path/to/mmproj.gguf (only if it ships its own)
#
# Requires: brew install llama.cpp
set -euo pipefail
# Homebrew bin may be missing from non-interactive shells
export PATH="/opt/homebrew/bin:/usr/local/bin:$PATH"
ROOT="$(cd "$(dirname "$0")/.." && pwd)"
GGUF="${FORMSCOUT_JUDGE_GGUF:-$ROOT/checkpoints/qwen3-vl/Qwen3VL-8B-Instruct-Q4_K_M.gguf}"
MMPROJ="${FORMSCOUT_JUDGE_MMPROJ:-$ROOT/checkpoints/qwen3-vl/mmproj-Qwen3VL-8B-Instruct-F16.gguf}"
HOST="${FORMSCOUT_LLAMA_HOST:-127.0.0.1}"
PORT="${FORMSCOUT_LLAMA_PORT:-8080}"
if [[ ! -f "$GGUF" ]]; then
echo "Model not found: $GGUF" >&2
echo "Download it with:" >&2
echo " python3 -c \"from huggingface_hub import hf_hub_download; [hf_hub_download('Qwen/Qwen3-VL-8B-Instruct-GGUF', f, local_dir='$ROOT/checkpoints/qwen3-vl') for f in ['Qwen3VL-8B-Instruct-Q4_K_M.gguf', 'mmproj-Qwen3VL-8B-Instruct-F16.gguf']]\"" >&2
exit 1
fi
exec llama-server \
--model "$GGUF" \
--mmproj "$MMPROJ" \
--host "$HOST" \
--port "$PORT" \
--ctx-size 16384 \
--n-gpu-layers 99 \
--no-warmup