Closed ephemer closed 6 months ago
@ephemer I just finished writing a C implementation of the v3.1 16kHz model. I'm working on it as a personal learning project, and it's very much in proof of concept stage. It probably won't build nor run anywhere but my machine atm. Having said that, if you don't mind the jank, look in my vadc repo, branch c_port_continued, this function tests the full model implementation https://github.com/IntendedConsequence/vadc/blob/b5c25db328a5fbee27a421a2d892de42bbaa3dd5/test.c#L1424
@IntendedConsequence thanks for sharing, that's really interesting work! 🙏🏼
🐛 Bug
It's not possible to convert the Silero VAD model to work with CoreML or with other conversion tools.
To Reproduce
Steps to reproduce the behavior:
Create the following script in the root directory of this repo and
pip install coremltools
. Then run:There are too many errors to list. I have tried to go through and comment out places where Exceptions are raised to try to get to the bottom of it, but I wasn't able to get even a broken output:
.name()
does not exist on the Tensor C type when determining whether this is a quantized modelExpected behavior
What I'm really trying to do is find a way to include silero-vad in a mobile app without having to bundle ONNX. I wasn't able to convert the .jit model to onnx myself either (I thought maybe I'd have more luck converting the resulting model to another format if it worked). I also attempted to use this tool to convert the onnx model to C but it also fails because
If
is not implemented there.Environment
Additional context
It would be really helpful to be able to modify the original Silero PyTorch model, for example to remove branching, implement the feature extractor in C directly, and so on. I'm curious whether you have considered that possibility for distribution of upcoming versions?