Skip to content

Commit

Permalink
Enhance flexibility by passing callbacks as method argument
Browse files Browse the repository at this point in the history
Signed-off-by: Michal Futrega <[email protected]>
  • Loading branch information
michal2409 authored and janekl committed Dec 13, 2023
1 parent af8daed commit 5e24036
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions nemo/collections/nlp/parts/megatron_trainer_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,10 @@ def _plugins(self) -> list:

return plugins

def create_trainer(self) -> Trainer:
def create_trainer(self, callbacks=(CustomProgressBar(),)) -> Trainer:
strategy = self._training_strategy()
plugins = self._plugins()
return Trainer(plugins=plugins, strategy=strategy, **self.cfg.trainer, callbacks=[CustomProgressBar()])
return Trainer(plugins=plugins, strategy=strategy, **self.cfg.trainer, callbacks=callbacks)


class MegatronBertTrainerBuilder(MegatronTrainerBuilder):
Expand Down

0 comments on commit 5e24036

Please sign in to comment.