运行 Speculators 模型
通过 speculators 训练的所有模型在其 config.json 中都包含一个 speculators_config。这些模型采用 speculators 格式,可以直接在 vLLM 中运行,使用 vllm serve </path/to/speculator/model> 命令,它将应用 speculators_config 中定义的所有推测性解码参数。
转换第三方库的模型
将第三方模型转换为 speculators 格式也是可取的。支持转换由其他研究库生成的推测解码器模型。可以在 convert/eagle3 目录下找到一个用于转换 Eagle3 模型 yuhuili/EAGLE3-LLaMA3.1-Instruct-8B 的示例 bash 脚本。
应用转换将
- 通过添加 speculators_config 来扩展模型的 config.json。这包含了正确的 EAGLE 和 EAGLE 3 配置字段。
- 使用正确的嵌入和重新映射的权重更新 model.safetensors。
- 实现完整的 vLLM 兼容性。
转换完成后,所有模型都可以使用 vllm serve </path/to/speculator/model> 命令运行。