Skip to content
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion vllm/model_executor/models/llama_eagle3.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,9 @@ def compute_logits(
) -> Optional[torch.Tensor]:
logits = self.logits_processor(self.lm_head, hidden_states,
sampling_metadata)
if self.draft_id_to_target_id is None:
return logits

base = torch.arange(self.config.draft_vocab_size, device=logits.device)
targets = base + self.draft_id_to_target_id
logits_new = logits.new_full((
Expand Down Expand Up @@ -245,4 +248,10 @@ def load_weights(self, weights: Iterable[tuple[str, torch.Tensor]]):
name = "model." + name
model_weights[name] = loaded_weight

return loader.load_weights(model_weights.items())
loaded_weights = loader.load_weights(model_weights.items())

if 'd2t' not in loaded_weights:
del self.draft_id_to_target_id
self.draft_id_to_target_id = None

return loaded_weights