Files
vLLM-Kunlunxin_p-800-tokeni…/vllm_wrapper.sh

18 lines
482 B
Bash
Raw Permalink Normal View History

2026-06-30 15:35:45 +08:00
#!/bin/bash
set -e
# 只拦截 "serve <model_dir>" 子命令,其他子命令直接透传
if [ "$1" = "serve" ] && [ -n "$2" ]; then
MODEL_DIR="$2"
shift 2
FIXED_DIR=$(python3 /opt/fix_tokenizer.py "$MODEL_DIR")
if [ -n "$FIXED_DIR" ]; then
exec /opt/vllm_kunlun/bin/vllm_real serve "$MODEL_DIR" --tokenizer "$FIXED_DIR" "$@"
else
exec /opt/vllm_kunlun/bin/vllm_real serve "$MODEL_DIR" "$@"
fi
fi
exec /opt/vllm_kunlun/bin/vllm_real "$@"