mirror of
https://github.com/snakers4/silero-vad.git
synced 2026-02-05 18:09:22 +08:00
fx dtype bug
This commit is contained in:
@@ -37,7 +37,6 @@ def silero_vad(onnx=False, force_onnx_cpu=False):
|
|||||||
raise Exception(f'Please install torch {supported_version} or greater ({installed_version} installed)')
|
raise Exception(f'Please install torch {supported_version} or greater ({installed_version} installed)')
|
||||||
|
|
||||||
model_dir = os.path.join(os.path.dirname(__file__), 'files')
|
model_dir = os.path.join(os.path.dirname(__file__), 'files')
|
||||||
print(model_dir, os.path.dirname(__file__))
|
|
||||||
if onnx:
|
if onnx:
|
||||||
model = OnnxWrapper(os.path.join(model_dir, 'silero_vad.onnx'), force_onnx_cpu)
|
model = OnnxWrapper(os.path.join(model_dir, 'silero_vad.onnx'), force_onnx_cpu)
|
||||||
else:
|
else:
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ class OnnxWrapper():
|
|||||||
|
|
||||||
x = torch.cat([self._context, x], dim=1)
|
x = torch.cat([self._context, x], dim=1)
|
||||||
if sr in [8000, 16000]:
|
if sr in [8000, 16000]:
|
||||||
ort_inputs = {'input': x.numpy(), 'state': self._state.numpy(), 'sr': np.array(sr)}
|
ort_inputs = {'input': x.numpy(), 'state': self._state.numpy(), 'sr': np.array(sr, dtype='int64')}
|
||||||
ort_outs = self.session.run(None, ort_inputs)
|
ort_outs = self.session.run(None, ort_inputs)
|
||||||
out, state = ort_outs
|
out, state = ort_outs
|
||||||
self._state = torch.from_numpy(state)
|
self._state = torch.from_numpy(state)
|
||||||
|
|||||||
Reference in New Issue
Block a user