"...git@developer.sourcefind.cn:chenpangpang/transformers.git" did not exist on "02488103007fe64577e3fa38732792bc58ca5b14"
Unverified Commit 1cd01b0a authored by Maximilian Schmidt's avatar Maximilian Schmidt Committed by GitHub
Browse files

Fix Comet ML integration (#17381)

Callback function `on_train_end` crashed if Comet ML integration was
used but `COMET_MODE` set to `DISABLE`
parent c86aad61
...@@ -729,12 +729,13 @@ class CometCallback(TrainerCallback): ...@@ -729,12 +729,13 @@ class CometCallback(TrainerCallback):
def on_train_end(self, args, state, control, **kwargs): def on_train_end(self, args, state, control, **kwargs):
if self._initialized and state.is_world_process_zero: if self._initialized and state.is_world_process_zero:
experiment = comet_ml.config.get_global_experiment() experiment = comet_ml.config.get_global_experiment()
if (experiment is not None) and (self._log_assets is True): if experiment is not None:
logger.info("Logging checkpoints. This may take time.") if self._log_assets is True:
experiment.log_asset_folder( logger.info("Logging checkpoints. This may take time.")
args.output_dir, recursive=True, log_file_name=True, step=state.global_step experiment.log_asset_folder(
) args.output_dir, recursive=True, log_file_name=True, step=state.global_step
experiment.end() )
experiment.end()
class AzureMLCallback(TrainerCallback): class AzureMLCallback(TrainerCallback):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment