Files
vLLM-MetaX_c-500-opt/vllm_wrapper.sh
4paradigm 6219e91e20
All checks were successful
Docker Build and Push / docker (push) Successful in 1m4s
fix tokenizer
2026-07-23 11:15:57 +08:00

19 lines
504 B
Bash

#!/bin/bash
set -e
# 只拦截 "serve <model_dir>" 子命令,其他子命令直接透传
# 适配 MetaX C500 / vLLM 0.9.1 环境
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/conda/bin/vllm_real serve "$MODEL_DIR" --tokenizer "$FIXED_DIR" "$@"
else
exec /opt/conda/bin/vllm_real serve "$MODEL_DIR" "$@"
fi
fi
exec /opt/conda/bin/vllm_real "$@"