Skip to content

Commit

Permalink
ignore logger if excephook is active
Browse files Browse the repository at this point in the history
  • Loading branch information
jjanezhang committed Jun 20, 2024
1 parent 4b1fecb commit 6c73ace
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions scripts/train/train.py
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,8 @@ def main(cfg: DictConfig) -> Trainer:
except BaseContextualError as e:
if mosaicml_logger is not None:
e.location = TrainDataLoaderLocation
mosaicml_logger.log_exception(e)
if os.environ.get('OVERRIDE_EXCEPTHOOK', 'false').lower() != 'true':
mosaicml_logger.log_exception(e)
raise e

if mosaicml_logger is not None:
Expand Down Expand Up @@ -429,7 +430,9 @@ def main(cfg: DictConfig) -> Trainer:
except BaseContextualError as e:
if mosaicml_logger is not None:
e.location = EvalDataLoaderLocation
mosaicml_logger.log_exception(e)
if os.environ.get('OVERRIDE_EXCEPTHOOK',
'false').lower() != 'true':
mosaicml_logger.log_exception(e)
raise e

if mosaicml_logger is not None:
Expand Down

0 comments on commit 6c73ace

Please sign in to comment.