Skip to content

Commit

Permalink
Merge branch 'main' into jerry/hf-model-download-script
Browse files Browse the repository at this point in the history
  • Loading branch information
jerrychen109 authored Nov 6, 2023
2 parents df41a46 + ffb58f1 commit 5421c0c
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions scripts/train/train.py
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,12 @@ def main(cfg: DictConfig) -> Trainer:
'compile_config',
must_exist=False,
default_value=None)
metadata: Optional[Dict[str, str]] = pop_config(cfg,
'metadata',
must_exist=False,
default_value=None,
convert=True)

# Enable autoresume from model checkpoints if possible
autoresume_default: bool = False
if logged_cfg.get('run_name', None) is not None \
Expand Down Expand Up @@ -460,6 +466,14 @@ def main(cfg: DictConfig) -> Trainer:
mosaicml_logger = MosaicMLLogger()
loggers.append(mosaicml_logger)

if metadata is not None:
# Flatten the metadata for logging
logged_cfg.pop('metadata', None)
logged_cfg.update(metadata, merge=True)
if mosaicml_logger is not None:
mosaicml_logger.log_metrics(metadata)
mosaicml_logger._flush_metadata(force_flush=True)

# Profiling
profiler: Optional[Profiler] = None
profiler_cfg: Optional[DictConfig] = pop_config(cfg,
Expand Down

0 comments on commit 5421c0c

Please sign in to comment.