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] fairseq fix missing dataset, model var initialization #3638

Closed
shoaib42 opened this issue Mar 18, 2024 · 2 comments · Fixed by eginhard/coqui-tts#11
Closed

[Bug] fairseq fix missing dataset, model var initialization #3638

shoaib42 opened this issue Mar 18, 2024 · 2 comments · Fixed by eginhard/coqui-tts#11
Labels
bug Something isn't working

Comments

@shoaib42
Copy link

Describe the bug

There are uninitialized variables that cause issues when loading the model. I hastily opened a PR and it got auto closed. #3471 . All details are in the PR

To Reproduce

import torch
from TTS.api import TTS

# Get device
device = "cuda" if torch.cuda.is_available() else "cpu"
api = TTS("tts_models/pol/fairseq/vits")
api.tts_with_vc_to_file(
    "Dzień dobry",
    speaker_wav="speech.wav",
    file_path="output.wav"
)

You'll get this error

Traceback (most recent call last):
  File "/home/shoaib/temp.py", line 6, in <module>
    api = TTS("tts_models/pol/fairseq/vits")
  File "/home/shoaib/.local/lib/python3.10/site-packages/TTS/api.py", line 74, in __init__
    self.load_tts_model_by_name(model_name, gpu)
  File "/home/shoaib/.local/lib/python3.10/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 "/home/shoaib/.local/lib/python3.10/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 "/home/shoaib/.local/lib/python3.10/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 "/home/shoaib/.local/lib/python3.10/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

Expected behavior

No response

Logs

No response

Environment

{
    "CUDA": {
        "GPU": [],
        "available": false,
        "version": "12.1"
    },
    "Packages": {
        "PyTorch_debug": false,
        "PyTorch_version": "2.1.2+cu121",
        "TTS": "0.22.0",
        "numpy": "1.26.3"
    },
    "System": {
        "OS": "Linux",
        "architecture": [
            "64bit",
            "ELF"
        ],
        "processor": "x86_64",
        "python": "3.10.12",
        "version": "#15~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Fri Jan 12 18:54:30 UTC 2"
    }
}

Additional context

No response

@shoaib42 shoaib42 added the bug Something isn't working label Mar 18, 2024
@eginhard
Copy link
Contributor

eginhard commented Apr 8, 2024

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

@shoaib42
Copy link
Author

Thanks, seems like a duplicate and the newer one got merged! Closing issue!

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

Successfully merging a pull request may close this issue.

2 participants