Skip to content

Instantly share code, notes, and snippets.

View abhigoyal1997's full-sized avatar

Abhinav Goyal abhigoyal1997

View GitHub Profile
@abhigoyal1997
abhigoyal1997 / convert_EAGLE_ckpt_to_vllm_compatible.py
Created August 7, 2024 08:57
An example of how to convert trained EAGLE checkpoint to vLLM compatible version
import json
import torch
from safetensors.torch import load_file, save_file
ckpt = torch.load("EAGLE-LLaMA3-Instruct-8B/pytorch_model.bin")
ref_ckpt = load_file("Meta-Llama-3-8B-Instruct/model-00004-of-00004.safetensors")
ckpt['lm_head.weight'] = ref_ckpt['lm_head.weight']