k2-fsa / sherpa-onnx

Speech-to-text, text-to-speech, speaker recognition, and VAD using next-gen Kaldi with onnxruntime without Internet connection. Support embedded systems, Android, iOS, Raspberry Pi, RISC-V, x86_64 servers, websocket server/client, C/C++, Python, Kotlin, C#, Go, NodeJS, Java, Swift, Dart, JavaScript, Flutter, Object Pascal, Lazarus, Rust

Home Page:https://k2-fsa.github.io/sherpa/onnx/index.html

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Whisper configuration is buggy

janjanusek opened this issue · comments

Hi there I tried following configuration via C# API 1.10.23

new OfflineRecognizer(new OfflineRecognizerConfig()
        {
            ModelConfig = new OfflineModelConfig()
            {
                Whisper = new OfflineWhisperModelConfig
                {
                    Task = "transcribe",
                    TailPaddings = 5000,
                    Language = metadata.Resource.OneTimeDynamicParams?.ToString()!.ToLower(),
                    Decoder = metadata
                        .Paths
                        .Single(x => x
                            .Split(Path.DirectorySeparatorChar)[^1]
                            .Contains("decoder")),
                    Encoder = metadata
                        .Paths
                        .Single(x => x
                            .Split(Path.DirectorySeparatorChar)[^1]
                            .Contains("encoder"))
                },
                Tokens = metadata
                    .Paths
                    .Single(x => x
                        .Split(Path.DirectorySeparatorChar)[^1]
                        .Contains("tokens"))
            }
        }));

Let's say I specify 'sk' as Slovak language but model seems to be still not working only with SK language and it just looks like it tries to automatically detect language and sometimes returns something in SK but it more looks it tries translate into EN. How can I achieve this behavior to use only specified language?

Could you post all of the commandline logs?

Please set the field Debug to True to print more logs.

my bad, I found bug in my own code...

Great to know you have fixed it.