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

[Bug] argument of type 'NoneType' is not iterable #2979

Closed
violet17 opened this issue Sep 21, 2023 · 5 comments
Closed

[Bug] argument of type 'NoneType' is not iterable #2979

violet17 opened this issue Sep 21, 2023 · 5 comments
Labels
bug Something isn't working

Comments

@violet17
Copy link

violet17 commented Sep 21, 2023

Describe the bug

Run the below code and get error like:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/i/miniconda3/envs/llm/lib/python3.9/site-packages/TTS/api.py", line 384, in tts_to_file
    self._check_arguments(speaker=speaker, language=language, speaker_wav=speaker_wav, **kwargs)
  File "/home/i/miniconda3/envs/llm/lib/python3.9/site-packages/TTS/api.py", line 237, in _check_arguments
    if self.is_multi_lingual and language is None:
  File "/home/i/miniconda3/envs/llm/lib/python3.9/site-packages/TTS/api.py", line 109, in is_multi_lingual
    if "xtts" in self.model_name:
TypeError: argument of type 'NoneType' is not iterable

no error on TTS 0.16.3 version。 And in 0.16.3 version, when len(text) for one setence is large than 50, the rest of text can not convert to speech, which will be cut off.
In the script below, I get no voice for "品尝美食,享受美味与旋转的乐趣".

TTS version :

$ python -m pip list | grep TTS
TTS                         0.17.4

To Reproduce

scripts:

from TTS.api import TTS
text = "游客可以登上观光球,欣赏上海全景和周边美景;或者在空中庭院中欣赏美景,感受大自然的气息;或者在旋转餐厅中品尝美食,享受美味与旋转的乐趣"
tts_model = TTS(model_path="./tacotron2-DDC-GST/model_file.pth", config_path="./tacotron2-DDC-GST/config.json", progress_bar=True, gpu=False)
tts_model.tts_to_file(text.replace("\n",",").replace(" ","")+"。", file_path="audio_out.wav")

Expected behavior

No response

Logs

No response

Environment

{
    "CUDA": {
        "GPU": [],
        "available": false,
        "version": null
    },
    "Packages": {
        "PyTorch_debug": false,
        "PyTorch_version": "2.0.1a0+cxx11.abi",
        "TTS": "0.17.4",
        "numpy": "1.24.0"
    },
    "System": {
        "OS": "Linux",
        "architecture": [
            "64bit",
            "ELF"
        ],
        "processor": "x86_64",
        "python": "3.9.17",
        "version": "#32~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Fri Aug 18 10:40:13 UTC 2"
    }
}

Additional context

No response

@violet17 violet17 added the bug Something isn't working label Sep 21, 2023
@abbail
Copy link

abbail commented Sep 21, 2023

It worked for me if I added tts_model.model_name="xtts" before calling tts_to_file, just as a workaround. It seems like for me the constructor for TTS wasn't working like I expected.

@erogol
Copy link
Member

erogol commented Sep 25, 2023

can you try #2983 ?

@braysonjohn148
Copy link

It worked for me if I added tts_model.model_name="xtts" before calling tts_to_file, just as a workaround. It seems like for me the constructor for TTS wasn't working like I expected.

Work for me.

@erogol
Copy link
Member

erogol commented Oct 9, 2023

duplicate #3019

@Edresson
Copy link
Contributor

It is fixed on the latest 🐸 TTS version. So, I will close this issue. Feel free to reopen it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants