should fix issue that arises when trying to prepare the dataset without slicing segments

This commit is contained in:
mrq 2023-08-23 21:49:22 +00:00
parent 0a5483e57a
commit 29290f574e

View File

@ -2535,7 +2535,7 @@ def prepare_dataset( voice, use_segments=False, text_length=0, audio_length=0, p
duration = 0 duration = 0
for segment in result['segments']: for segment in result['segments']:
duration = max(duration, result['segments'][segment]['end']) duration = max(duration, segment['end'])
if duration >= MAX_TRAINING_DURATION: if duration >= MAX_TRAINING_DURATION:
message = f"Audio too large, using segments: {filename}" message = f"Audio too large, using segments: {filename}"