Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Alphabet is not defined despite being loaded. #36

Open
ArEnSc opened this issue Aug 17, 2020 · 1 comment
Open

Alphabet is not defined despite being loaded. #36

ArEnSc opened this issue Aug 17, 2020 · 1 comment

Comments

@ArEnSc
Copy link

ArEnSc commented Aug 17, 2020

Ran a small example it doesn't produce the align.json file.

"""
Traceback (most recent call last):
  File "/usr/local/Cellar/python@3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/lib/python3.8/multiprocessing/pool.py", line 125, in worker
    result = (True, func(*args, **kwds))
  File "/Users/raisintoastllc/MachineLearning/Projects/SpeechSynthesis/DataProcessing/DSAlign/align/align.py", line 85, in align
    tc = read_script(script)
  File "/Users/raisintoastllc/MachineLearning/Projects/SpeechSynthesis/DataProcessing/DSAlign/align/align.py", line 47, in read_script
    tc = TextCleaner(alphabet,
NameError: name 'alphabet' is not defined
"""

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/Users/raisintoastllc/MachineLearning/Projects/SpeechSynthesis/DataProcessing/DSAlign/align/align.py", line 682, in <module>
    main()
  File "/Users/raisintoastllc/MachineLearning/Projects/SpeechSynthesis/DataProcessing/DSAlign/align/align.py", line 521, in main
    for aligned_file, file_total_fragments, file_dropped_fragments, file_reasons in \
  File "/Users/raisintoastllc/MachineLearning/Projects/SpeechSynthesis/DataProcessing/DSAlign/align/utils.py", line 73, in log_progress
    for global_step, obj in enumerate(it, 1):
  File "/usr/local/Cellar/python@3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/lib/python3.8/multiprocessing/pool.py", line 868, in next
    raise value
NameError: name 'alphabet' is not defined
@ArEnSc
Copy link
Author

ArEnSc commented Aug 17, 2020

def align(triple):
    tlog, script, aligned = triple
    args = parse_args() <-- add this here


args = parse_args() <-- hard code here
    alphabet = Alphabet("/Users//MachineLearning/Projects/SpeechSynthesis/DataProcessing/DSAlign/models/en/alphabet.txt") <-- hard code here
    tc = TextCleaner(alphabet,
                     dashes_to_ws=not args.text_keep_dashes,
                     normalize_space=not args.text_keep_ws,
                     to_lower=not args.text_keep_casing)

That fixes it mostly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant