# "Worker died" error while performing inference on large text

**URL:** <https://discuss.huggingface.co/t/worker-died-error-while-performing-inference-on-large-text/35585>\
**Category:** Inference Endpoints on the Hub\
**Created:** [April 5, 2023, 1:32am UTC](https://discuss.huggingface.co/t/worker-died-error-while-performing-inference-on-large-text/35585 "2023-04-05T01:32:35Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nomesh](https://avatars.discourse-cdn.com/v4/letter/n/e99b99/32.png) [@Nomesh](https://discuss.huggingface.co/u/Nomesh)\
**Post date:** [April 5, 2023, 1:32am UTC](https://discuss.huggingface.co/t/worker-died-error-while-performing-inference-on-large-text/35585/1 "2023-04-05T01:32:35Z")

</div>

I want to use feature extraction task using ‘EleutherAI/gpt-neo-125M’ but when I provide text, I got “worker died” error. I tried to look into logs and find out the error shows `io.netty.handler.codec.CorruptedFrameException: Message size exceed limit: 14010754`  
Kindly help to resolve this error, Thanks in advance

---

<div class="post-metadata">

**Author:** ![ishangupta](https://avatars.discourse-cdn.com/v4/letter/i/9fc29f/32.png) [@ishangupta](https://discuss.huggingface.co/u/ishangupta)\
**Post date:** [April 10, 2024, 8:06pm UTC](https://discuss.huggingface.co/t/worker-died-error-while-performing-inference-on-large-text/35585/2 "2024-04-10T20:06:08Z")

</div>

Hey @Nomesh, did you end up finding a solution for this?

---

<div class="post-metadata">

**Author:** ![dudelstein](https://avatars.discourse-cdn.com/v4/letter/d/848f3c/32.png) [@dudelstein](https://discuss.huggingface.co/u/dudelstein)\
**Post date:** [July 19, 2024, 8:13pm UTC](https://discuss.huggingface.co/t/worker-died-error-while-performing-inference-on-large-text/35585/3 "2024-07-19T20:13:19Z")

</div>

Hey, I think the solution might be to increase the maximum allowed size using env variables as follows (or endpoint equivalent), this worked for me:

```auto
transformer = huggingface_model.transformer(
    instance_count=1,
    output_path = s3_output,
    instance_type="ml.m5.xlarge",
    assemble_with="Line",
    max_payload=6,
    strategy='SingleRecord',
    env={'SAGEMAKER_MODEL_SERVER_TIMEOUT':'3600', 
         'TS_MAX_RESPONSE_SIZE':'2000000000',
         'TS_MAX_REQUEST_SIZE':'2000000000',
         'MMS_MAX_RESPONSE_SIZE':'2000000000',
         'MMS_MAX_REQUEST_SIZE':'2000000000'}
)

```
