Initialize logging in training script for both main and non-main processes

- Added `init_logging` calls to ensure proper logging setup when using the accelerator and in standard training mode.
- This change enhances the clarity and consistency of logging during training sessions.
This commit is contained in:
AdilZouitine
2025-10-03 16:43:05 +02:00
parent f30da2dec1
commit dbce707db5

View File

@@ -439,6 +439,9 @@ if __name__ == "__main__":
# We set step_scheduler_with_optimizer False to prevent accelerate from
# adjusting the lr_scheduler steps based on the num_processes
accelerator = accelerate.Accelerator(step_scheduler_with_optimizer=False)
init_logging(accelerator=accelerator)
train(accelerator=accelerator)
else:
init_logging()
train()