# 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:** 4

<div class="post-metadata">

**Author:** ![philschmid](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/philschmid/32/38022_2.png) [@philschmid](https://discuss.huggingface.co/u/philschmid)\
**Post date:** [May 18, 2022, 1:12pm UTC](https://discuss.huggingface.co/t/serveless-memory-problem-when-deploy-wav2vec2-with-custom-inference-code/18023/4 "2022-05-18T13:12:27Z")

</div>

@diegoseto is there a particular reason why you are creating a `inference.py` script? You can directly provide your `HF_API_TOKEN` in the `hub` configuration next to you model id and task. See [**`HF_API_TOKEN`**](https://huggingface.co/docs/sagemaker/reference#inference-toolkit-environment-variables)

---

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