Skip to content

Commit

Permalink
barest bones trainer
Browse files Browse the repository at this point in the history
  • Loading branch information
Sara Adkins committed Apr 2, 2024
1 parent 4f619bd commit e425523
Showing 1 changed file with 1 addition and 37 deletions.
38 changes: 1 addition & 37 deletions src/sparseml/transformers/finetune/trainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,40 +25,4 @@


class Trainer(SessionManagerMixIn, HFTransformersTrainer):
"""
Training implementation for running sparsification recipes with HF Trainer.
:param model: the model to use with the trainer and apply sparsification to
:param recipe: the recipe, if any, to apply to the modle and training
process
:param recipe_args: A json string, csv key=value string, or dictionary containing
arguments to override the root arguments within the recipe such as
learning rate or num epochs
:param teacher: teacher model for distillation. Set to 'self' to distill
from the loaded model or 'disable' to turn of distillation
:param kwargs: key word arguments passed to the parent class
"""

def __init__(
self,
model: Optional[Module] = None,
model_init: Optional[Callable] = None,
recipe: Optional[str] = None,
recipe_args: Optional[Union[Dict[str, Any], str]] = None,
teacher: Optional[Union[Module, str]] = None,
**kwargs,
):
super().__init__(
model=model,
model_init=model_init,
recipe=recipe,
recipe_args=recipe_args,
teacher=teacher,
**kwargs,
)

def _dummy_lr_scheduler(self):
return torch.optim.lr_scheduler.MultiplicativeLR(
self.optimizer,
lambda _: 1.0,
)
pass

0 comments on commit e425523

Please sign in to comment.