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/infer/speech_edit.py
CHANGED
@@ -154,7 +154,7 @@ for part in parts_to_edit:
|
|
154 |
dim=-1,
|
155 |
)
|
156 |
offset = end * target_sample_rate
|
157 |
-
|
158 |
edit_mask = F.pad(edit_mask, (0, audio.shape[-1] // hop_length - edit_mask.shape[-1] + 1), value=True)
|
159 |
audio = audio.to(device)
|
160 |
edit_mask = edit_mask.to(device)
|
|
|
154 |
dim=-1,
|
155 |
)
|
156 |
offset = end * target_sample_rate
|
157 |
+
audio = torch.cat((audio_, audio[:, round(offset) :]), dim=-1)
|
158 |
edit_mask = F.pad(edit_mask, (0, audio.shape[-1] // hop_length - edit_mask.shape[-1] + 1), value=True)
|
159 |
audio = audio.to(device)
|
160 |
edit_mask = edit_mask.to(device)
|