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

got error when using fairseq #3501

Closed
uyplayer opened this issue Jan 7, 2024 · 4 comments · Fixed by eginhard/coqui-tts#11
Closed

got error when using fairseq #3501

uyplayer opened this issue Jan 7, 2024 · 4 comments · Fixed by eginhard/coqui-tts#11
Labels
bug Something isn't working wontfix This will not be worked on but feel free to help.

Comments

@uyplayer
Copy link

uyplayer commented Jan 7, 2024

Describe the bug



from TTS.api import TTS


tts = TTS(model_name="tts_models/eng/fairseq/vits", progress_bar=False, gpu=True)
tts.tts_to_file("This is a test.", file_path="output.wav")

To Reproduce

got following error

D:\Software\anaconda3\envs\freqtrade310\python.exe C:\Users\uyplayer\Downloads\uig-script_arabic\model.py 
D:\Software\anaconda3\envs\freqtrade310\lib\site-packages\TTS\api.py:70: UserWarning: `gpu` will be deprecated. Please use `tts.to(device)` instead.
  warnings.warn("`gpu` will be deprecated. Please use `tts.to(device)` instead.")
Traceback (most recent call last):
  File "C:\Users\uyplayer\Downloads\uig-script_arabic\model.py", line 5, in <module>
    tts = TTS(model_name="tts_models/eng/fairseq/vits", progress_bar=False, gpu=True)
  File "D:\Software\anaconda3\envs\freqtrade310\lib\site-packages\TTS\api.py", line 74, in __init__
    self.load_tts_model_by_name(model_name, gpu)
  File "D:\Software\anaconda3\envs\freqtrade310\lib\site-packages\TTS\api.py", line 171, in load_tts_model_by_name
    model_path, config_path, vocoder_path, vocoder_config_path, model_dir = self.download_model_by_name(
  File "D:\Software\anaconda3\envs\freqtrade310\lib\site-packages\TTS\api.py", line 129, in download_model_by_name
    model_path, config_path, model_item = self.manager.download_model(model_name)
  File "D:\Software\anaconda3\envs\freqtrade310\lib\site-packages\TTS\utils\manage.py", line 385, in download_model
    model_item, model_full_name, model, md5sum = self._set_model_item(model_name)
  File "D:\Software\anaconda3\envs\freqtrade310\lib\site-packages\TTS\utils\manage.py", line 304, in _set_model_item
    model_full_name = f"{model_type}--{lang}--{dataset}--{model}"
UnboundLocalError: local variable 'dataset' referenced before assignment

Process finished with exit code 1

Expected behavior

No response

Logs

No response

Environment

Sys: Windows11
Python : 3.10
TTS : 0.22.0
Torch : 2.1.2

Additional context

i saw other issues and said this was fixed , but i still got this error

@uyplayer uyplayer added the bug Something isn't working label Jan 7, 2024
@uyplayer uyplayer changed the title got error when uisng fairseq got error when using fairseq Jan 7, 2024
@Dhruv16S
Copy link

Dhruv16S commented Jan 24, 2024

Describe the bug



from TTS.api import TTS


tts = TTS(model_name="tts_models/eng/fairseq/vits", progress_bar=False, gpu=True)
tts.tts_to_file("This is a test.", file_path="output.wav")

To Reproduce

got following error

D:\Software\anaconda3\envs\freqtrade310\python.exe C:\Users\uyplayer\Downloads\uig-script_arabic\model.py 
D:\Software\anaconda3\envs\freqtrade310\lib\site-packages\TTS\api.py:70: UserWarning: `gpu` will be deprecated. Please use `tts.to(device)` instead.
  warnings.warn("`gpu` will be deprecated. Please use `tts.to(device)` instead.")
Traceback (most recent call last):
  File "C:\Users\uyplayer\Downloads\uig-script_arabic\model.py", line 5, in <module>
    tts = TTS(model_name="tts_models/eng/fairseq/vits", progress_bar=False, gpu=True)
  File "D:\Software\anaconda3\envs\freqtrade310\lib\site-packages\TTS\api.py", line 74, in __init__
    self.load_tts_model_by_name(model_name, gpu)
  File "D:\Software\anaconda3\envs\freqtrade310\lib\site-packages\TTS\api.py", line 171, in load_tts_model_by_name
    model_path, config_path, vocoder_path, vocoder_config_path, model_dir = self.download_model_by_name(
  File "D:\Software\anaconda3\envs\freqtrade310\lib\site-packages\TTS\api.py", line 129, in download_model_by_name
    model_path, config_path, model_item = self.manager.download_model(model_name)
  File "D:\Software\anaconda3\envs\freqtrade310\lib\site-packages\TTS\utils\manage.py", line 385, in download_model
    model_item, model_full_name, model, md5sum = self._set_model_item(model_name)
  File "D:\Software\anaconda3\envs\freqtrade310\lib\site-packages\TTS\utils\manage.py", line 304, in _set_model_item
    model_full_name = f"{model_type}--{lang}--{dataset}--{model}"
UnboundLocalError: local variable 'dataset' referenced before assignment

Process finished with exit code 1

Expected behavior

No response

Logs

No response

Environment

Sys: Windows11
Python : 3.10
TTS : 0.22.0
Torch : 2.1.2

Additional context

i saw other issues and said this was fixed , but i still got this error

Hi @uyplayer. I encountered a similar issue recently, and I guess you are referring to the fix as mentioned here. If you have used the command pip install TTS, prior to using this model, this change has not been reflected yet for some reason.
Instead, you can modify the manage.py file at the location where you installed the TTS package. Simply add the line model_type, lang, dataset, model = model_name.split("/") as mentioned in the following snippet. For instance, in my local environment, I performed the updates at env/lib/site-packages/TTS/utils/manage.py, and it solved the problem for me.

Copy link

stale bot commented Feb 24, 2024

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.

@stale stale bot added the wontfix This will not be worked on but feel free to help. label Feb 24, 2024
@stale stale bot closed this as completed Mar 3, 2024
@rainloha
Copy link

Please make those change to this file TTS/utils/manage.py

ligne 263

    #model_type = "tts_models"
    #lang = model_name.split("/")[1]
    model_type, lang, dataset, model = model_name.split("/")

regards

@eginhard
Copy link
Contributor

eginhard commented Apr 8, 2024

This is fixed in our fork: https://github.com/idiap/coqui-ai-TTS

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working wontfix This will not be worked on but feel free to help.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants