From 5aa4766033db4edd02e69d869953b2ec5f8bbd07 Mon Sep 17 00:00:00 2001 From: jerrister Date: Tue, 26 Nov 2024 14:03:00 +0800 Subject: [PATCH] Fix sample timesteps --- src/f5_tts/model/cfm.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/f5_tts/model/cfm.py b/src/f5_tts/model/cfm.py index 2c88de341..9ae675c98 100644 --- a/src/f5_tts/model/cfm.py +++ b/src/f5_tts/model/cfm.py @@ -193,7 +193,7 @@ def fn(t, x): y0 = (1 - t_start) * y0 + t_start * test_cond steps = int(steps * (1 - t_start)) - t = torch.linspace(t_start, 1, steps, device=self.device, dtype=step_cond.dtype) + t = torch.linspace(t_start, 1, steps + 1, device=self.device, dtype=step_cond.dtype) if sway_sampling_coef is not None: t = t + sway_sampling_coef * (torch.cos(torch.pi / 2 * t) - 1 + t)