fix tokenizer
All checks were successful
Docker Build and Push / docker (push) Successful in 1m4s

This commit is contained in:
4paradigm
2026-07-23 15:20:18 +08:00
commit 43a9d6fe07
6 changed files with 311 additions and 0 deletions

19
vllm_wrapper.sh Normal file
View File

@@ -0,0 +1,19 @@
#!/bin/bash
set -e
VLLM_REAL="$(dirname "$(readlink -f "$0")")/vllm_real"
# 仅拦截 vllm 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 "$VLLM_REAL" serve "$MODEL_DIR" --tokenizer "$FIXED_DIR" "$@"
fi
exec "$VLLM_REAL" serve "$MODEL_DIR" "$@"
fi
exec "$VLLM_REAL" "$@"