#!/usr/bin/env bash # iris-3b-turbo-gb10 entrypoint. Runs inside the container; takes no arguments. # Port of gx10 ~/code/vlmtest/machines/gx10/start_iris3b_turbo.sh: the same server # (vlmtest/iris3b_server.py, copied unchanged) with the same env, on pinned weights mounted # read-only at /weights/iris. The text encoder (Qwen3-VL-4B-Instruct) is its own artifact here; gx10 kept it inside the weights folder. set -eu export HF_HUB_OFFLINE=1 TRANSFORMERS_OFFLINE=1 export PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True export MODEL_DIR="/weights/iris" export IRIS_SRC="/opt/iris3b/src" export IRIS_VARIANT="turbo" export IRIS_TEXT_ENCODER="/weights/text_encoder" export IRIS_NULL_EMBED_DIR="/scratch/iris-null-embeds" export SERVED_MODEL_ID="iris-3b-turbo" export PORT="$M64_PORT" echo '{"phase":"loading","detail":"loading Iris-3B Turbo (4 steps)"}' >> "$M64_STATUS" # The server loads its model before it listens (or answers /health with "loading"): # report ready once /health says "ok". python3 - <<'PY' & import json, os, time, urllib.request t0 = time.time() url = "http://127.0.0.1:%s/health" % os.environ["M64_PORT"] opener = urllib.request.build_opener(urllib.request.ProxyHandler({})) while True: try: r = opener.open(url, timeout=3) if r.status == 200 and json.loads(r.read() or b"{}").get("status", "ok") == "ok": break except Exception: pass time.sleep(5) with open(os.environ["M64_STATUS"], "a") as f: f.write(json.dumps({"phase": "ready", "detail": "loaded in %d s" % (time.time() - t0)}) + "\n") PY exec python3 -u /capsule/iris3b_server.py