sglang tp_dp_matrix: fix empty DATASET_PATH causing docker invalid spec
When DATASET_PATH is empty, -v ::ro is passed to docker run, which produces 'invalid spec: ::ro: empty section between colons'. Build the volume args dynamically and only add the dataset mount when the path is non-empty.
This commit is contained in:
parent
4ea6e92b42
commit
605b976fb8
@ -120,11 +120,15 @@ restart_server() {
|
||||
run_bench_serving() {
|
||||
# Run sglang.bench_serving either natively or inside the SGLang Docker image.
|
||||
if [[ "${USE_DOCKER_CLIENT:-1}" == "1" ]]; then
|
||||
local vol_args=()
|
||||
vol_args+=("-v" "${MODEL_PATH}:${MODEL_PATH}:ro")
|
||||
if [[ -n "${DATASET_PATH:-}" ]]; then
|
||||
vol_args+=("-v" "${DATASET_PATH}:${DATASET_PATH}:ro")
|
||||
fi
|
||||
vol_args+=("-v" "${RESULT_BASE}:${RESULT_BASE}")
|
||||
docker run --rm \
|
||||
--network host \
|
||||
-v "${MODEL_PATH}:${MODEL_PATH}:ro" \
|
||||
-v "${DATASET_PATH}:${DATASET_PATH}:ro" \
|
||||
-v "${RESULT_BASE}:${RESULT_BASE}" \
|
||||
"${vol_args[@]}" \
|
||||
-e PYTHONUNBUFFERED=1 \
|
||||
"${DOCKER_IMAGE}" \
|
||||
python -m sglang.bench_serving "$@"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user