# Serveless memory problem when deploy Wav2Vec2 with custom inference code

**URL:** <https://discuss.huggingface.co/t/serveless-memory-problem-when-deploy-wav2vec2-with-custom-inference-code/18023>\
**Category:** Amazon SageMaker\
**Created:** [May 16, 2022, 10:12pm UTC](https://discuss.huggingface.co/t/serveless-memory-problem-when-deploy-wav2vec2-with-custom-inference-code/18023 "2022-05-16T22:12:18Z")\
**Posts on this page:** 1\
**Showing post:** 9

<div class="post-metadata">

**Author:** ![diegoseto](https://avatars.discourse-cdn.com/v4/letter/d/6a8cbe/32.png) [@diegoseto](https://discuss.huggingface.co/u/diegoseto)\
**Post date:** [May 19, 2022, 3:34pm UTC](https://discuss.huggingface.co/t/serveless-memory-problem-when-deploy-wav2vec2-with-custom-inference-code/18023/9 "2022-05-19T15:34:25Z")

</div>

No, i mean the use of a language model to boosting wav2vec2 decoding as described by @patrickvonplaten here [How to create Wav2Vec2 With Language model](https://discuss.huggingface.co/t/how-to-create-wav2vec2-with-language-model/12703), but in Amazon Sagemaker (serveless). In this topic @philschmid suggested using custom inference script, but i’m having problems as mentioned above.

There is another option to use a language model without a custom inference script?

---

_[View the full topic](https://discuss.huggingface.co/t/serveless-memory-problem-when-deploy-wav2vec2-with-custom-inference-code/18023)._
