Integrating wav2vec2.0 in C++ code

497 views
Skip to first unread message

Kocelot Gepardieu

unread,
Jan 27, 2021, 6:33:00 AM1/27/21
to fairseq Users
Hi fariseq Users & Developers,
I'm experimenting with integrating wav2vec2.0 models (Wav2VecEncoder) in C++ app. I was following some recipes published on PyTorch site which relate to generic PyTorch models and tried both scripting and tracing approach, however there are numerous issues both ways. Some are fairly easy to overcome (eg. monkey-patching enum classes which are problematic for pytorch jit compiler or removing support for keyword arguments), but still I can't get to have workable solution. Does anybody have any success in this field, could you share your approach or some advices? What about exporting via ONNX? Any hints would be extremaly useful.

Thanks,
-Andrzej

Yunusemre Ozkose

unread,
May 11, 2021, 5:05:29 AM5/11/21
to fairseq Users
Hi Andrej,

Did you find a solution?

Yunusemre

27 Ocak 2021 Çarşamba tarihinde saat 14:33:00 UTC+3 itibarıyla andrzej.c...@gmail.com şunları yazdı:

Andrzej Ciarkowski

unread,
May 11, 2021, 6:34:59 AM5/11/21
to Yunusemre Ozkose, fairseq Users
Hi Yunusemre, 
No, at this moment I abandoned this direction and went for the models from Huggingface 

-Andrzej 

--
You received this message because you are subscribed to a topic in the Google Groups "fairseq Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/fairseq-users/2iO2eD-rY4I/unsubscribe.
To unsubscribe from this group and all its topics, send an email to fairseq-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/fairseq-users/ffca32ca-f6b6-420b-958d-1c83dce268c3n%40googlegroups.com.

Chuan Zhang

unread,
Dec 26, 2025, 7:20:59 PM (11 days ago) 12/26/25
to fairseq Users
Hi,

I had Claude Code build a C++ version of wav2vec2.  Compared results to reference Pytorch implementation on an audio set looked pretty good to me.  Was surprised that Q4_K quantization got such similar results to F32.  Was able to get this integrated in an iOS app about 200MB bin.

https://github.com/engineerchuan/wav2vec2.cpp

Chuan
Reply all
Reply to author
Forward
0 new messages