coqui-ai / TTS

🐸💬 - a deep learning toolkit for Text-to-Speech, battle-tested in research and production
http://coqui.ai
Mozilla Public License 2.0
35.07k stars 4.27k forks source link

[Bug] kss formatter doesn't set the root_path attribute #2156

Closed github40912 closed 1 year ago

github40912 commented 1 year ago

Describe the bug

https://github.com/coqui-ai/TTS/blob/v0.9.0/TTS/tts/datasets/formatters.py#L602

To Reproduce


KeyError                                  Traceback (most recent call last)
/tmp/ipykernel_23/1931759875.py in <module>
     72     eval_split=True,
     73     eval_split_max_size=config.eval_split_max_size,
---> 74     eval_split_size=config.eval_split_size,
     75 )

/opt/conda/lib/python3.7/site-packages/TTS/tts/datasets/__init__.py in load_tts_samples(datasets, eval_split, formatter, eval_split_max_size, eval_split_size)
    121         assert len(meta_data_train) > 0, f" [!] No training samples found in {root_path}/{meta_file_train}"
    122 
--> 123         meta_data_train = add_extra_keys(meta_data_train, language, dataset_name)
    124 
    125         print(f" | > Found {len(meta_data_train)} files in {Path(root_path).resolve()}")

/opt/conda/lib/python3.7/site-packages/TTS/tts/datasets/__init__.py in add_extra_keys(metadata, language, dataset_name)
     62         item["language"] = language
     63         # add unique audio name
---> 64         relfilepath = os.path.splitext(os.path.relpath(item["audio_file"], item["root_path"]))[0]
     65         audio_unique_name = f"{dataset_name}#{relfilepath}"
     66         item["audio_unique_name"] = audio_unique_name

KeyError: 'root_path'

Expected behavior

No response

Logs

No response

Environment

v0.9.0

Additional context

No response

stale[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. You might also look our discussion channels.