# Train and inference wav2vec2 using a language model

**URL:** <https://discuss.huggingface.co/t/train-and-inference-wav2vec2-using-a-language-model/5906>\
**Category:** Intermediate\
**Created:** [May 1, 2021, 9:34am UTC](https://discuss.huggingface.co/t/train-and-inference-wav2vec2-using-a-language-model/5906 "2021-05-01T09:34:36Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![soroushhashemifar](https://avatars.discourse-cdn.com/v4/letter/s/eb9ed0/32.png) [@soroushhashemifar](https://discuss.huggingface.co/u/soroushhashemifar)\
**Post date:** [May 1, 2021, 9:34am UTC](https://discuss.huggingface.co/t/train-and-inference-wav2vec2-using-a-language-model/5906/1 "2021-05-01T09:34:36Z")

</div>

Hi everyone. Is it possible to use a language model built with KenLM for train and inference steps of Wav2Vec2 model? If so, please share any resource on this. Thanks in advance

---

<div class="post-metadata">

**Author:** ![patrickvonplaten](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/patrickvonplaten/32/2171_2.png) [@patrickvonplaten](https://discuss.huggingface.co/u/patrickvonplaten)\
**Post date:** [May 2, 2021, 8:50am UTC](https://discuss.huggingface.co/t/train-and-inference-wav2vec2-using-a-language-model/5906/2 "2021-05-02T08:50:34Z")

</div>

Hey,

We don’t have a lot of code that support LM decoding for Wav2Vec2 sadly.

This notebook: [huggingface\_notebook/xlsr\_gpt.ipynb at main · voidful/huggingface\_notebook · GitHub](https://github.com/voidful/huggingface_notebook/blob/main/xlsr_gpt.ipynb) might help
