ops
This commit is contained in:
parent
e624473aaa
commit
01f71754eb
11
src/utils.py
11
src/utils.py
@ -1421,7 +1421,12 @@ def prepare_dataset( voice, use_segments=False, text_length=0, audio_length=0, p
|
||||
if use_segment and not use_segments:
|
||||
exists = True
|
||||
for segment in result['segments']:
|
||||
if os.path.exists(filename.replace(".wav", f"_{pad(segment['id'], 4)}.wav")):
|
||||
duration = segment['end'] - segment['start']
|
||||
if duration <= MIN_TRAINING_DURATION or MAX_TRAINING_DURATION <= duration:
|
||||
continue
|
||||
|
||||
path = f'{indir}/audio/' + filename.replace(".wav", f"_{pad(segment['id'], 4)}.wav")
|
||||
if os.path.exists(path):
|
||||
continue
|
||||
exists = False
|
||||
break
|
||||
@ -1443,6 +1448,10 @@ def prepare_dataset( voice, use_segments=False, text_length=0, audio_length=0, p
|
||||
}
|
||||
else:
|
||||
for segment in result['segments']:
|
||||
duration = segment['end'] - segment['start']
|
||||
if duration <= MIN_TRAINING_DURATION or MAX_TRAINING_DURATION <= duration:
|
||||
continue
|
||||
|
||||
segments[filename.replace(".wav", f"_{pad(segment['id'], 4)}.wav")] = {
|
||||
'text': segment['text'],
|
||||
'language': language,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user