mirror of https://github.com/coqui-ai/TTS.git
fix Lint check
This commit is contained in:
parent
1d73566e4e
commit
7c12e94ee4
|
@ -229,14 +229,14 @@ def vctk(root_path, meta_files=None, wavs_path='wav48'):
|
||||||
items = []
|
items = []
|
||||||
meta_files = glob(f"{os.path.join(root_path,'txt')}/**/*.txt", recursive=True)
|
meta_files = glob(f"{os.path.join(root_path,'txt')}/**/*.txt", recursive=True)
|
||||||
for meta_file in meta_files:
|
for meta_file in meta_files:
|
||||||
txt, speaker_id, txt_file = os.path.relpath(meta_file,root_path).split(os.sep)
|
_, speaker_id, txt_file = os.path.relpath(meta_file, root_path).split(os.sep)
|
||||||
file_id = txt_file.split('.')[0]
|
file_id = txt_file.split('.')[0]
|
||||||
if isinstance(test_speakers, list): # if is list ignore this speakers ids
|
if isinstance(test_speakers, list): # if is list ignore this speakers ids
|
||||||
if speaker_id in test_speakers:
|
if speaker_id in test_speakers:
|
||||||
continue
|
continue
|
||||||
with open(meta_file) as file_text:
|
with open(meta_file) as file_text:
|
||||||
text = file_text.readlines()[0]
|
text = file_text.readlines()[0]
|
||||||
wav_file = os.path.join(root_path, wavs_path, speaker_id,file_id+'.wav')
|
wav_file = os.path.join(root_path, wavs_path, speaker_id, file_id+'.wav')
|
||||||
items.append([text, wav_file, speaker_id])
|
items.append([text, wav_file, speaker_id])
|
||||||
|
|
||||||
return items
|
return items
|
|
@ -147,7 +147,6 @@ def check_argument(name, c, enum_list=None, max_val=None, min_val=None, restrict
|
||||||
if enum_list:
|
if enum_list:
|
||||||
assert c[name].lower() in enum_list, f' [!] {name} is not a valid value'
|
assert c[name].lower() in enum_list, f' [!] {name} is not a valid value'
|
||||||
if isinstance(val_type, list):
|
if isinstance(val_type, list):
|
||||||
valid_types = val_type
|
|
||||||
is_valid = False
|
is_valid = False
|
||||||
for typ in val_type:
|
for typ in val_type:
|
||||||
if isinstance(c[name], typ):
|
if isinstance(c[name], typ):
|
||||||
|
|
Loading…
Reference in New Issue