Improve verify auto-detection without docker
This commit is contained in:
40
verify.sh
40
verify.sh
@@ -106,17 +106,45 @@ for m in mounts:
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# ---------------------------------------------------------------- model dir
|
# ---------------------------------------------------------------- model dir
|
||||||
if [[ -z "${MODEL_DIR}" ]]; then
|
SCOUT_DEFAULT="/mnt/disk0/models/LLM-Research/Llama-4-Scout-17B-16E-Instruct"
|
||||||
for candidate in \
|
MAVERICK_DEFAULT="/mnt/disk0/models/LLM-Research/Llama-4-Maverick-17B-128E-Instruct-FP8"
|
||||||
"/mnt/disk0/models/LLM-Research/Llama-4-Scout-17B-16E-Instruct" \
|
|
||||||
"/mnt/disk0/models/LLM-Research/Llama-4-Maverick-17B-128E-Instruct-FP8"; do
|
# 没有 docker 时(例如在 ugly_hopper 内运行),按端口探测正在运行的服务。
|
||||||
if [[ -f "${candidate}/config.json" ]]; then
|
if [[ -z "${CONTAINER}" && -z "${PORT}" && -z "${MODEL_DIR}" && -z "${BASE_URL}" ]]; then
|
||||||
MODEL_DIR="${candidate}"
|
for candidate_port in 8091 8092; do
|
||||||
|
if curl -fsS --max-time 2 "http://127.0.0.1:${candidate_port}/health" >/dev/null 2>&1; then
|
||||||
|
PORT="${candidate_port}"
|
||||||
break
|
break
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# 从 served name 反推模型目录(方便 --base-url + --served-name 的用法)。
|
||||||
|
if [[ -z "${MODEL_DIR}" && -n "${SERVED_NAME}" ]]; then
|
||||||
|
case "${SERVED_NAME}" in
|
||||||
|
*maverick*)
|
||||||
|
if [[ -f "${MAVERICK_DEFAULT}/config.json" ]]; then
|
||||||
|
MODEL_DIR="${MAVERICK_DEFAULT}"
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
*scout*)
|
||||||
|
if [[ -f "${SCOUT_DEFAULT}/config.json" ]]; then
|
||||||
|
MODEL_DIR="${SCOUT_DEFAULT}"
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ -z "${MODEL_DIR}" && -z "${BASE_URL}" ]]; then
|
||||||
|
if [[ "${PORT}" == "8092" && -f "${MAVERICK_DEFAULT}/config.json" ]]; then
|
||||||
|
MODEL_DIR="${MAVERICK_DEFAULT}"
|
||||||
|
elif [[ -f "${SCOUT_DEFAULT}/config.json" ]]; then
|
||||||
|
MODEL_DIR="${SCOUT_DEFAULT}"
|
||||||
|
elif [[ -f "${MAVERICK_DEFAULT}/config.json" ]]; then
|
||||||
|
MODEL_DIR="${MAVERICK_DEFAULT}"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
DETECT_JSON=""
|
DETECT_JSON=""
|
||||||
if [[ -n "${MODEL_DIR}" ]]; then
|
if [[ -n "${MODEL_DIR}" ]]; then
|
||||||
if [[ -f "${MODEL_DIR}/config.json" ]]; then
|
if [[ -f "${MODEL_DIR}/config.json" ]]; then
|
||||||
|
|||||||
Reference in New Issue
Block a user