I can't make the example run

#17
by Javedalam - opened

Hi

I have been trying to run the example you have provided on the model page . It keeps giving me error.

Here is the link to Google colab notebook. https://colab.research.google.com/drive/1xY7ngcE53U7uTGGYYoh_BZ5GBWQLVnO4?usp=sharing

Please let me know what I am doing wrong. Thank You Javed

I got the same error as yours, I missed the following

First, clone the Git repository:

git clone https://github.com/2noise/ChatTTS.git

after I have cloned the repo, and now having the following error:

---------------------------------------------------------------------------
UnboundLocalError                         Traceback (most recent call last)
Cell In[1], line 21
     16 texts = [
     17     "So we found being competitive and collaborative was a huge way of staying motivated towards our goals, so one person to call when you fall off, one person who gets you back on then one person to actually do the activity with.",
     18     ]
     20 # Perform inference and play the generated audio
---> 21 wavs = chat.infer(texts)
     22 Audio(wavs[0], rate=24_000, autoplay=True)
     24 # Save the generated audio 

File ~/projects/ai/text-to-audio/ChatTTS/ChatTTS/core.py:146, in Chat.infer(self, text, skip_refine_text, refine_text_only, params_refine_text, params_infer_code, use_decoder, do_text_normalization, lang)
    144 for i, t in enumerate(text):
    145     _lang = detect_language(t) if lang is None else lang
--> 146     self.init_normalizer(_lang)
    147     text[i] = self.normalizer[_lang](t)
    148     if _lang == 'zh':

File ~/projects/ai/text-to-audio/ChatTTS/ChatTTS/core.py:199, in Chat.init_normalizer(self, lang)
    196 except:
    197     self.logger.log(logging.WARNING, f'Package nemo_text_processing not found! \
    198         Run: conda install -c conda-forge pynini=2.1.5 && pip install nemo_text_processing')
--> 199 self.normalizer[lang] = partial(Normalizer(input_case='cased', lang=lang).normalize, verbose=False, punct_post_process=True)

UnboundLocalError: cannot access local variable 'Normalizer' where it is not associated with a value

Sign up or log in to comment