Files
vLLM-Iluvatar_bi-150-opt/README.md
2026-07-21 10:18:53 +08:00

27 lines
1.0 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# BI-150 TokenizersBackend 修复补丁
基于 BI-150 vLLM 0.8.3 镜像,仅修复以下错误:
```text
ValueError: Tokenizer class TokenizersBackend does not exist or is not currently imported.
```
## 工作方式
镜像构建时用 wrapper 接管 `vllm` 命令。执行 `vllm serve <model_dir>` 时:
1. 读取模型的 `tokenizer_config.json`
2. 仅当 `tokenizer_class` 严格等于 `TokenizersBackend` 时,将 tokenizer 文件复制到 `/tmp/fixed_tokenizer`
3. 根据已有文件选择替代类:`tokenizer.json` 使用 `PreTrainedTokenizerFast``tokenizer.model` 使用 `LlamaTokenizer``vocab.json``merges.txt` 使用 `GPT2TokenizerFast`;无法判断时回退到 `PreTrainedTokenizerFast`
4. 向原始 vLLM 命令追加 `--tokenizer /tmp/fixed_tokenizer`
原模型目录不会被修改。其他 tokenizer 错误及其他 `tokenizer_class` 均不处理。
## 构建
```bash
docker build -t iluvatar-bi150-vllm-tokenizer-fix:0.8.3 .
```
使用时仅替换原 BI-150 镜像名,`vllm serve` 参数保持不变。