Skip to content

Commit

Permalink
Add description for reload func
Browse files Browse the repository at this point in the history
  • Loading branch information
natuan committed Jun 30, 2023
1 parent 80620f1 commit d19c550
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/sparseml/transformers/sparsification/trainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -653,6 +653,10 @@ def _setup_manager(
return manager, arch_manager

def _reload_model_state(self, load_path: str, orig_state_dict: Dict[str, Any]):
"""
Reload the weights after model arch changes due to recipe application
Return True if weights are successfully reloaded; False otherwise
"""
invalid_load_path = not load_path or not os.path.isdir(load_path)
files = os.listdir(load_path) if not invalid_load_path else []
weight_files = [
Expand Down

0 comments on commit d19c550

Please sign in to comment.