Skip to content

Commit c98cc29

Browse files
authored
Revert "fix: Make Recipe.model_dump() output compatible .... (#1378)
This PR reverts commit 998be99 which was merged prematurely. The required base tests were skipped during the original review process. When these tests eventually ran on the main branch, they revealed a failure: https://github.com/vllm-project/llm-compressor/actions/runs/14628792870/job/41046641641 The original PR #1328 has been reopened to address the identified issues before resubmitting.
1 parent e627edf commit c98cc29

File tree

2 files changed

+1
-82
lines changed

2 files changed

+1
-82
lines changed

src/llmcompressor/recipe/recipe.py

Lines changed: 1 addition & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def from_modifiers(
4646
4747
(Note: all modifiers are wrapped into a single stage
4848
with the modifier_group_name as the stage name. If modifier_group_name is None,
49-
the default run_type is `oneshot`)
49+
the default run type is `oneshot`)
5050
5151
Lfecycle:
5252
| - Validate Modifiers
@@ -524,33 +524,6 @@ def dict(self, *args, **kwargs) -> Dict[str, Any]:
524524

525525
return dict_
526526

527-
def model_dump(self, *args, **kwargs) -> Dict[str, Any]:
528-
"""
529-
Override the model_dump method to provide a dictionary representation that
530-
is compatible with model_validate.
531-
532-
Unlike the standard model_dump, this transforms the stages list to a format
533-
expected by the validation logic, ensuring round-trip compatibility with
534-
model_validate.
535-
536-
:return: A dictionary representation of the recipe compatible with
537-
model_validate
538-
"""
539-
# Get the base dictionary from parent class
540-
base_dict = super().model_dump(*args, **kwargs)
541-
542-
# Transform stages into the expected format
543-
if "stages" in base_dict:
544-
stages_dict = {}
545-
for stage in base_dict["stages"]:
546-
group = stage["group"]
547-
if group not in stages_dict:
548-
stages_dict[group] = []
549-
stages_dict[group].append(stage)
550-
base_dict["stages"] = stages_dict
551-
552-
return base_dict
553-
554527
def yaml(self, file_path: Optional[str] = None) -> str:
555528
"""
556529
Return a yaml string representation of the recipe.

tests/recipe/test_recipe.py

Lines changed: 0 additions & 54 deletions
This file was deleted.

0 commit comments

Comments
 (0)