m64_3ad665d84176 / start.sh
38 lines, 1.6 KBraw
1#!/usr/bin/env bash2# iris-3b-turbo-gb10 entrypoint. Runs inside the container; takes no arguments.3# Port of gx10 ~/code/vlmtest/machines/gx10/start_iris3b_turbo.sh: the same server4# (vlmtest/iris3b_server.py, copied unchanged) with the same env, on pinned weights mounted5# read-only at /weights/iris. The text encoder (Qwen3-VL-4B-Instruct) is its own artifact here; gx10 kept it inside the weights folder.6set -eu78export HF_HUB_OFFLINE=1 TRANSFORMERS_OFFLINE=19export PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True10export MODEL_DIR="/weights/iris"11export IRIS_SRC="/opt/iris3b/src"12export IRIS_VARIANT="turbo"13export IRIS_TEXT_ENCODER="/weights/text_encoder"14export IRIS_NULL_EMBED_DIR="/scratch/iris-null-embeds"15export SERVED_MODEL_ID="iris-3b-turbo"16export PORT="$M64_PORT"1718echo '{"phase":"loading","detail":"loading Iris-3B Turbo (4 steps)"}' >> "$M64_STATUS"19# The server loads its model before it listens (or answers /health with "loading"):20# report ready once /health says "ok".21python3 - <<'PY' &22import json, os, time, urllib.request23t0 = time.time()24url = "http://127.0.0.1:%s/health" % os.environ["M64_PORT"]25opener = urllib.request.build_opener(urllib.request.ProxyHandler({}))26while True:27 try:28 r = opener.open(url, timeout=3)29 if r.status == 200 and json.loads(r.read() or b"{}").get("status", "ok") == "ok":30 break31 except Exception:32 pass33 time.sleep(5)34with open(os.environ["M64_STATUS"], "a") as f:35 f.write(json.dumps({"phase": "ready", "detail": "loaded in %d s" % (time.time() - t0)}) + "\n")36PY3738exec python3 -u /capsule/iris3b_server.py