Skip to content

Commit

Permalink
fix double initialization
Browse files Browse the repository at this point in the history
Signed-off-by: Kyle Sayers <[email protected]>
  • Loading branch information
kylesayrs committed Feb 18, 2025
1 parent 60371ef commit bf9a8cd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/llmcompressor/core/lifecycle.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,11 @@ def initialize(
:return: List of data returned from initialization of modifiers
:rtype: List[Any]
"""
logger.debug("Initializing compression lifecycle")
self.state.update(**kwargs)
if self.initialized_: # TODO: do not initialize twice
return

logger.debug("Initializing compression lifecycle")
self.recipe_container.append(recipe, recipe_stage, recipe_args)
self.modifiers = self.recipe_container.get_modifiers()
self._set_model_layer_prefix()
Expand Down
2 changes: 1 addition & 1 deletion src/llmcompressor/transformers/utils/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ def infer_recipe_from_model_path(model_path: Union[str, Path]) -> Optional[str]:
recipe = recipe_from_huggingface_model_id(hf_stub=model_path)

if recipe is None:
logger.info("Failed to infer the recipe from the model_path")
logger.debug("Failed to infer the recipe from the model_path")

return recipe

Expand Down

0 comments on commit bf9a8cd

Please sign in to comment.