# Error invoking inference endpoint

**URL:** <https://discuss.huggingface.co/t/error-invoking-inference-endpoint/55971>\
**Category:** Amazon SageMaker\
**Created:** [September 22, 2023, 7:11am UTC](https://discuss.huggingface.co/t/error-invoking-inference-endpoint/55971 "2023-09-22T07:11:18Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vandalism](https://avatars.discourse-cdn.com/v4/letter/v/d2c977/32.png) [@Vandalism](https://discuss.huggingface.co/u/Vandalism)\
**Post date:** [September 22, 2023, 7:11am UTC](https://discuss.huggingface.co/t/error-invoking-inference-endpoint/55971/1 "2023-09-22T07:11:18Z")

</div>

![endpoint error](https://us1.discourse-cdn.com/hellohellohello/original/3X/4/7/473b44a358f4b893f110025ed05efdccb16a3535.png)

The model i’ve used to deploy is

> **[tomaarsen/span-marker-roberta-large-ontonotes5 · Hugging Face](https://huggingface.co/tomaarsen/span-marker-roberta-large-ontonotes5)**
>
> We’re on a journey to advance and democratize artificial intelligence through open source and open science.

I’ve also tried downloading spanmarker

import requests

url = “[GitHub - tomaarsen/SpanMarkerNER: SpanMarker for Named Entity Recognition](https://github.com/tomaarsen/SpanMarkerNER)”  
response = requests.get(url)  
with open(“requirements.txt”, “wb”) as f:  
f.write(response.content)

and putting it into a “model creation”

hub = {  
‘HF\_MODEL\_ID’:‘tomaarsen/span-marker-roberta-large-ontonotes5’,  
‘HF\_TASK’:‘span-marker’  
}

huggingface\_model = HuggingFaceModel(  
transformers\_version = ‘4.28.1’,  
pytorch\_version=‘2.0.0’,  
py\_version=‘py310’,  
role=‘arn:aws:iam::026588382219:role/service-role/AmazonSageMaker-ExecutionRole-20230920T145199’,  
env=hub,  
dependencies=[‘requirements.txt’]  
)

---

<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:** [September 22, 2023, 7:32am UTC](https://discuss.huggingface.co/t/error-invoking-inference-endpoint/55971/2 "2023-09-22T07:32:04Z")

</div>

Spanmaker models are not supported by default you would need to write a custom inference.py script.

---

<div class="post-metadata">

**Author:** ![Vandalism](https://avatars.discourse-cdn.com/v4/letter/v/d2c977/32.png) [@Vandalism](https://discuss.huggingface.co/u/Vandalism)\
**Post date:** [September 22, 2023, 8:23am UTC](https://discuss.huggingface.co/t/error-invoking-inference-endpoint/55971/3 "2023-09-22T08:23:21Z")

</div>

Can you provide any content for creating a custom container image? Thanks

---

<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:** [September 22, 2023, 9:01am UTC](https://discuss.huggingface.co/t/error-invoking-inference-endpoint/55971/4 "2023-09-22T09:01:19Z")

</div>

Here is an example for sentence transformers you can follow the same steps [Creating document embeddings with Hugging Face's Transformers & Amazon SageMaker](https://www.philschmid.de/custom-inference-huggingface-sagemaker)
