mirror of https://github.com/coqui-ai/TTS.git
fix: more helpful error message when formatter is not found
This commit is contained in:
parent
75d082563e
commit
e81f8d079c
|
@ -166,6 +166,11 @@ def load_attention_mask_meta_data(metafile_path):
|
||||||
def _get_formatter_by_name(name):
|
def _get_formatter_by_name(name):
|
||||||
"""Returns the respective preprocessing function."""
|
"""Returns the respective preprocessing function."""
|
||||||
thismodule = sys.modules[__name__]
|
thismodule = sys.modules[__name__]
|
||||||
|
if not hasattr(thismodule, name.lower()):
|
||||||
|
msg = (
|
||||||
|
f"{name} formatter not found. If it is a custom formatter, pass the function to load_tts_samples() instead."
|
||||||
|
)
|
||||||
|
raise ValueError(msg)
|
||||||
return getattr(thismodule, name.lower())
|
return getattr(thismodule, name.lower())
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue