Skip to content

Commit f099649

Browse files
committed
0.5.0 fix grad_accum bug from 0.4.0, #715 #728
1 parent 0d95df4 commit f099649

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "f5-tts"
7-
version = "0.4.6"
7+
version = "0.5.0"
88
description = "F5-TTS: A Fairytaler that Fakes Fluent and Faithful Speech with Flow Matching"
99
readme = "README.md"
1010
license = {text = "MIT License"}

src/f5_tts/model/trainer.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -360,8 +360,9 @@ def train(self, train_dataset: Dataset, num_workers=16, resumable_with_seed: int
360360
self.scheduler.step()
361361
self.optimizer.zero_grad()
362362

363-
if self.is_main and self.accelerator.sync_gradients:
364-
self.ema_model.update()
363+
if self.accelerator.sync_gradients:
364+
if self.is_main:
365+
self.ema_model.update()
365366

366367
global_update += 1
367368
progress_bar.update(1)

0 commit comments

Comments
 (0)