k2-fsa / sherpa-onnx

Speech-to-text, text-to-speech, speaker diarization, 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
https://k2-fsa.github.io/sherpa/onnx/index.html
Apache License 2.0
3.54k stars 413 forks source link

generate-subtitles.py 怎么指定使用GPU ? #1361

Closed zx3777 closed 1 month ago

zx3777 commented 1 month ago

我已经安装了GPU版本的Sherpa-onnx

但是没找到generate-subtitles.py哪里可以指定GPU, 我用的是sensevoic.

csukuangfj commented 1 month ago

provider 设置成 'cuda'

https://github.com/k2-fsa/sherpa-onnx/blob/647b63ea44a259be5bb5d4080199f37447ba19c6/sherpa-onnx/python/sherpa_onnx/offline_recognizer.py#L189