sherpa-onnx icon indicating copy to clipboard operation
sherpa-onnx copied to clipboard

TTS bug

Open janjanusek opened this issue 7 months ago • 27 comments

Hello, I'm using your TTS library and must say it's very good, but I have no idea why when I instantiate OfflineTts model and run generate it returns result, but when I do it second time on the same instance I'll get error, for model I'm using this

new OfflineTtsModelConfig()
        {
            Vits = new OfflineTtsVitsModelConfig()
            {
                Tokens = Description.Tokens.FullName,
                Model = Description.OnnxModel.FullName,
                DataDir = Description.NgDataDir.FullName,
                NoiseScale = 0,
                NoiseScaleW = 0
            },
            Provider = "cpu",
            NumThreads = 1,
            Debug = 1
        },
        MaxNumSentences = 1
    }

I'm using org.k2fsa.sherpa.onnx package and tried all possible versions, also alongside I'm using as referrence within my project onnx runtime (for my other models) but that should not affect this package. My app is running on NET8, and I'm using Win11 with EU based lang.

error I'm getting on second run for any input (even the same one):

D:\a\sherpa-onnx\sherpa-onnx\sherpa-onnx/csrc/offline-tts-vits-impl.h:Generate:165 Raw text: John
2024-07-06 19:33:02.2001917 [E:onnxruntime:, sequential_executor.c
c:516 onnxruntime::ExecuteKernel] Non-zero status code returned wh
ile running GatherElements node. Name:'/dp/flows.7/GatherElements_
3' Status Message: C:\a\_work\1\s\onnxruntime\core\providers\cpu\t
ensor\gather_elements.cc:154 onnxruntime::core_impl GatherElements op: Out of range value in index tensor

worth to notice that when I create another instance it works again for single use..

janjanusek avatar Jul 06 '24 23:07 janjanusek