StyleTTS2 icon indicating copy to clipboard operation
StyleTTS2 copied to clipboard

StyleTTS Python API doesn't detect devanagari script

Open tanishbajaj101 opened this issue 1 year ago • 0 comments

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

tanishbajaj101 avatar Jul 19 '24 09:07 tanishbajaj101