Skip to content

Commit 01be4d9

Browse files
committed
polish
Signed-off-by: h-guo18 <67671475+h-guo18@users.noreply.github.com>
1 parent 93f864e commit 01be4d9

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

modelopt/recipe/config.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -143,9 +143,12 @@ class ModelOptEagleRecipe(ModelOptSpeculativeRecipeBase):
143143
)
144144

145145
@model_validator(mode="after")
146-
def _resolve_eagle_cross_section(self) -> ModelOptEagleRecipe:
147-
"""Fill cross-section fields and warn on inconsistencies once all sections are loaded."""
146+
def _derive_eagle_offline(self) -> ModelOptEagleRecipe:
148147
self.eagle.eagle_offline = self.data.offline_data_path is not None
148+
return self
149+
150+
@model_validator(mode="after")
151+
def _warn_rope_vs_training_seq_len(self) -> ModelOptEagleRecipe:
149152
orig_max_pos = self.eagle.eagle_export_rope_scaling.get("original_max_position_embeddings")
150153
if orig_max_pos is not None and orig_max_pos != self.training.training_seq_len:
151154
warnings.warn(
@@ -169,7 +172,7 @@ class ModelOptDFlashRecipe(ModelOptSpeculativeRecipeBase):
169172
)
170173

171174
@model_validator(mode="after")
172-
def _resolve_dflash_cross_section(self) -> ModelOptDFlashRecipe:
175+
def _derive_dflash_offline(self) -> ModelOptDFlashRecipe:
173176
self.dflash.dflash_offline = self.data.offline_data_path is not None
174177
return self
175178

0 commit comments

Comments
 (0)