chore: vendor sglang v0.5.10 snapshot
This commit is contained in:
34
third_party/sglang/docker/serve
vendored
Executable file
34
third_party/sglang/docker/serve
vendored
Executable file
@@ -0,0 +1,34 @@
|
||||
#!/bin/bash
|
||||
echo "Starting server"
|
||||
|
||||
PREFIX="SM_SGLANG_"
|
||||
ARG_PREFIX="--"
|
||||
|
||||
ARGS=()
|
||||
|
||||
while IFS='=' read -r key value; do
|
||||
arg_name=$(echo "${key#"${PREFIX}"}" | tr '[:upper:]' '[:lower:]' | tr '_' '-')
|
||||
|
||||
ARGS+=("${ARG_PREFIX}${arg_name}")
|
||||
if [ -n "$value" ]; then
|
||||
ARGS+=("$value")
|
||||
fi
|
||||
done < <(env | grep "^${PREFIX}")
|
||||
|
||||
# Add default port only if not already set
|
||||
if ! [[ " ${ARGS[@]} " =~ " --port " ]]; then
|
||||
ARGS+=(--port "${SM_SGLANG_PORT:-8080}")
|
||||
fi
|
||||
|
||||
# Add default host only if not already set
|
||||
if ! [[ " ${ARGS[@]} " =~ " --host " ]]; then
|
||||
ARGS+=(--host "${SM_SGLANG_HOST:-0.0.0.0}")
|
||||
fi
|
||||
|
||||
# Add default model-path only if not already set
|
||||
if ! [[ " ${ARGS[@]} " =~ " --model-path " ]]; then
|
||||
ARGS+=(--model-path "${SM_SGLANG_MODEL_PATH:-/opt/ml/model}")
|
||||
fi
|
||||
|
||||
echo "Running command: exec python3 -m sglang.launch_server ${ARGS[@]}"
|
||||
exec python3 -m sglang.launch_server "${ARGS[@]}"
|
||||
Reference in New Issue
Block a user