Skip to content

Commit 3205916

Browse files
committed
apply coderabbit suggestion
Signed-off-by: Ye Yu <[email protected]>
1 parent e966230 commit 3205916

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

modelopt/torch/speculative/plugins/megatron_eagle.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1199,8 +1199,15 @@ def forward(
11991199
if self.eagle_offline:
12001200
# aux_hidden_states and hidden_states are provided for offline eagle
12011201
# _base_model_forward is skipped
1202+
if return_eagle_inputs:
1203+
raise ValueError("return_eagle_inputs is unsupported in EAGLE offline mode.")
12021204
aux_hidden_states = kwargs.get("aux_hidden_states")
12031205
hidden_states = kwargs.get("hidden_states")
1206+
if aux_hidden_states is None or hidden_states is None:
1207+
raise ValueError(
1208+
"EAGLE offline mode requires kwargs: aux_hidden_states=[s,b,k*h], "
1209+
"hidden_states=[s,b,h]."
1210+
)
12041211
else:
12051212
# When return_eagle_inputs is True, return decoder_input_for_eagle.
12061213
# For LLM, decoder_input_for_eagle is just the text embeddings. However, for VLM

0 commit comments

Comments
 (0)