karim23657 / Persian-tts-coqui

Persian/Farsi text to speech(TTS) training using coqui tts
MIT License
117 stars 18 forks source link

error while running #39

Open danialhedaiat opened 5 months ago

danialhedaiat commented 5 months ago

hi i got this error when i run your tutorial code

Traceback (most recent call last):
  File "D:\workspace\AIs\MyTTS.py", line 34, in <module>
    tts.tts_to_file(".زندگی فقط یک بار است؛ از آن به خوبی استفاده کن",file_path='output.wav')
  File "D:\workspace\AIs\venv\Lib\site-packages\TTS\api.py", line 332, in tts_to_file
    self._check_arguments(speaker=speaker, language=language, speaker_wav=speaker_wav, **kwargs)
  File "D:\workspace\AIs\venv\Lib\site-packages\TTS\api.py", line 228, in _check_arguments
    if self.is_multi_lingual and language is None:
       ^^^^^^^^^^^^^^^^^^^^^
  File "D:\workspace\AIs\venv\Lib\site-packages\torch\nn\modules\module.py", line 1709, in __getattr__
    raise AttributeError(f"'{type(self).__name__}' object has no attribute '{name}'")
AttributeError: 'TTS' object has no attribute 'is_multi_lingual'

Process finished with exit code 1

and this is the code

from TTS.api import TTS
tts=TTS(model_path="https://huggingface.co/Kamtera/persian-tts-male1-vits/resolve/main/checkpoint_88000.pth",
        config_path="https://huggingface.co/Kamtera/persian-tts-male1-vits/resolve/main/config.json")
tts.tts_to_file(".زندگی فقط یک بار است؛ از آن به خوبی استفاده کن",file_path='output.wav') 

i also got same error when i download a model , that you pretrained and run it with this code

import torch
from TTS.api import TTS

device = "cuda" if torch.cuda.is_available() else "cpu"

# Initialize the TTS model
tts = TTS(
    model_path="persian-tts-male1-vits_checkpoint_88000.pth",  # Use custom model
    config_path="persian-tts-male1-vits_config.json"
).to(device)

text = "سلام به همه حالتون چطوره سلاطین"

tts.tts_to_file(text=text, language="fa", file_path="output.wav")

and this is the error

Traceback (most recent call last):
  File "D:\workspace\AIs\MyTTS.py", line 18, in <module>
    tts.tts_to_file(text=text, language="fa", file_path="output.wav")
  File "D:\workspace\AIs\venv\Lib\site-packages\TTS\api.py", line 332, in tts_to_file
    self._check_arguments(speaker=speaker, language=language, speaker_wav=speaker_wav, **kwargs)
  File "D:\workspace\AIs\venv\Lib\site-packages\TTS\api.py", line 228, in _check_arguments
    if self.is_multi_lingual and language is None:
       ^^^^^^^^^^^^^^^^^^^^^
  File "D:\workspace\AIs\venv\Lib\site-packages\torch\nn\modules\module.py", line 1709, in __getattr__
    raise AttributeError(f"'{type(self).__name__}' object has no attribute '{name}'")
AttributeError: 'TTS' object has no attribute 'is_multi_lingual'

Process finished with exit code 1

can any one help me ?

karim23657 commented 1 month ago

Hello @danialhedaiat , Try older versions of coqui tts, bash pip install TTS==0.14.0