Skip to content

Commit

Permalink
Fix vad & speech command tutorial - onnx (NVIDIA#7671) (NVIDIA#7672)
Browse files Browse the repository at this point in the history
* fix vad onnx



* fix mbn onnx



---------

Signed-off-by: fayejf <[email protected]>
Co-authored-by: fayejf <[email protected]>
  • Loading branch information
github-actions[bot] and fayejf authored Oct 10, 2023
1 parent efaeffd commit 91272fa
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions tutorials/asr/Online_Offline_Microphone_VAD_Demo.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -559,7 +559,7 @@
"CHANNELS = 1\n",
"RATE = 16000\n",
"audio, sample_rate = librosa.load(wave_file, sr=RATE)\n",
"dur = librosa.get_duration(audio)\n",
"dur = librosa.get_duration(y=audio, sr=sample_rate)\n",
"print(dur)"
]
},
Expand Down Expand Up @@ -798,7 +798,7 @@
"source": [
"import onnxruntime\n",
"vad_model.export('vad.onnx')\n",
"ort_session = onnxruntime.InferenceSession('vad.onnx')\n",
"ort_session = onnxruntime.InferenceSession('vad.onnx', providers=['CPUExecutionProvider'])\n",
"\n",
"def to_numpy(tensor):\n",
" return tensor.detach().cpu().numpy() if tensor.requires_grad else tensor.cpu().numpy()\n",
Expand Down
2 changes: 1 addition & 1 deletion tutorials/asr/Online_Offline_Speech_Commands_Demo.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -695,7 +695,7 @@
"source": [
"import onnxruntime\n",
"mbn_model.export('mbn.onnx')\n",
"ort_session = onnxruntime.InferenceSession('mbn.onnx')\n",
"ort_session = onnxruntime.InferenceSession('mbn.onnx', providers=['CPUExecutionProvider'])\n",
"\n",
"def to_numpy(tensor):\n",
" return tensor.detach().cpu().numpy() if tensor.requires_grad else tensor.cpu().numpy()\n",
Expand Down

0 comments on commit 91272fa

Please sign in to comment.