yl4579 / StyleTTS2

StyleTTS 2: Towards Human-Level Text-to-Speech through Style Diffusion and Adversarial Training with Large Speech Language Models
MIT License
4.97k stars 419 forks source link

StyleTTS Python API doesn't detect devanagari script #272

Open tanishbajaj101 opened 4 months ago

tanishbajaj101 commented 4 months ago

the script works fine for latin characters, I trained the checkpoint on phonemization of hindi text But on passing it devanagari script it gives me error

Traceback (most recent call last): File "C:\StyleTTS2\tts.py", line 7, in other_tts.inference("कैसे हो आप", output_wav_file="another_test.wav") File "C:\StyleTTS2\virt\lib\site-packages\styletts2\tts.py", line 273, in inference pred_aln_trg[i, c_frame:c_frame + int(pred_dur[i].data)] = 1 IndexError: invalid index of a 0-dim tensor. Use tensor.item() in Python or tensor.item<T>() in C++ to convert a 0-dim tensor to a number

from styletts2 import tts

Specific paths to a checkpoint and config can also be provided.

other_tts = tts.StyleTTS2(model_checkpoint_path='Models/LJSpeech/epoch_2nd_00004.pth')

Specify target voice to clone. When no target voice is provided, a default voice will be used.

other_tts.inference("कैसे हो आप", output_wav_file="another_test.wav")

this is the python code im trying to run