Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ignore mosaicml logger for exception if excephook is active #1301

Merged
merged 10 commits into from
Jun 24, 2024
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
Loading