Spaces:
Running
on
Zero
Running
on
Zero
Sync from GitHub repo
Browse filesThis Space is synced from the GitHub repo: https://github.com/SWivid/F5-TTS. Please submit contributions to the Space there
src/f5_tts/model/trainer.py
CHANGED
@@ -395,6 +395,9 @@ class Trainer:
|
|
395 |
self.writer.add_scalar("loss", loss.item(), global_update)
|
396 |
self.writer.add_scalar("lr", self.scheduler.get_last_lr()[0], global_update)
|
397 |
|
|
|
|
|
|
|
398 |
if global_update % self.save_per_updates == 0 and self.accelerator.sync_gradients:
|
399 |
self.save_checkpoint(global_update)
|
400 |
|
@@ -430,9 +433,6 @@ class Trainer:
|
|
430 |
)
|
431 |
self.model.train()
|
432 |
|
433 |
-
if global_update % self.last_per_updates == 0 and self.accelerator.sync_gradients:
|
434 |
-
self.save_checkpoint(global_update, last=True)
|
435 |
-
|
436 |
self.save_checkpoint(global_update, last=True)
|
437 |
|
438 |
self.accelerator.end_training()
|
|
|
395 |
self.writer.add_scalar("loss", loss.item(), global_update)
|
396 |
self.writer.add_scalar("lr", self.scheduler.get_last_lr()[0], global_update)
|
397 |
|
398 |
+
if global_update % self.last_per_updates == 0 and self.accelerator.sync_gradients:
|
399 |
+
self.save_checkpoint(global_update, last=True)
|
400 |
+
|
401 |
if global_update % self.save_per_updates == 0 and self.accelerator.sync_gradients:
|
402 |
self.save_checkpoint(global_update)
|
403 |
|
|
|
433 |
)
|
434 |
self.model.train()
|
435 |
|
|
|
|
|
|
|
436 |
self.save_checkpoint(global_update, last=True)
|
437 |
|
438 |
self.accelerator.end_training()
|