C++ Inference Code by Using ONNX model #12
Replies: 3 comments 2 replies
-
|
Following Python code I used to export the checkpoint to ONNX model `import torch class CUPEPredictONNX(nn.Module): Exportdef export_to_onnx(cupe_ckpt_path, output_path="cupe_predict_english.onnx", dummy_wav_len=1891): Usageckpt_path = "en_libri1000_ua01c_e4_val_GER3D0.2186.ckpt" |
Beta Was this translation helpful? Give feedback.
-
|
Thanks for the code. I have tried to improve it further. Try the latest C++ port in There is also a compiled binary for linux with CUDA12 at You will need to set paths int main()
{
init_reverse_lookups();
// Configuration — update paths to match your setup
std::string onnx_path = "../../models/en_libri1000_ua01c_e4_val_GER=0.2186.ckpt.onnx";
std::string audio_path = "../../examples/samples/audio/109867__timkahn__butterfly.wav";First export the model with bournemouth_aligner/cpp_onix/export_cupe_to_onnx.py Currently missing the espeak integration. This example has pre-computed phonemes. |
Beta Was this translation helpful? Give feedback.
-
|
Is onnx version faster? On CPU/GPU. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi Team, I am trying to get the timestamps with BFA in C++. I have converted the checkpoint model to ONNX model and taking output with ONNX runtime (ort). I am currently facing issue to convert the ViterbiDecoder class and its method in C++. I am attaching the Python file i am referring for inference, C++ code made so far and the exported ONNX model.
bfaonnx.py
main.cpp
Beta Was this translation helpful? Give feedback.
All reactions