Merge pull request #474 from spottenn/main

Fixed redact index error bug https://github.com/neonbjb/tortoise-tts/
This commit is contained in:
James Betker 2023-06-10 15:20:54 -07:00 committed by GitHub
commit 4566816cb4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -135,7 +135,7 @@ class Wav2VecAlignment:
non_redacted_intervals = []
last_point = 0
for i in range(len(fully_split)):
if i % 2 == 0:
if i % 2 == 0 and fully_split[i] != "": # Check for empty string fixes index error
end_interval = max(0, last_point + len(fully_split[i]) - 1)
non_redacted_intervals.append((last_point, end_interval))
last_point += len(fully_split[i])