# Error invoking inference endpoint

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Ferror-invoking-inference-endpoint%2F55971%3E%5C
**Category:** Amazon SageMaker\
**Created:** [September 22, 2023, 7:11am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Ferror-invoking-inference-endpoint%2F55971 "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](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2FVandalism)%5C
**Post date:** [September 22, 2023, 7:11am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Ferror-invoking-inference-endpoint%2F55971%2F1 "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](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fphilschmid)%5C
**Post date:** [September 22, 2023, 7:32am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Ferror-invoking-inference-endpoint%2F55971%2F2 "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](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2FVandalism)%5C
**Post date:** [September 22, 2023, 8:23am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Ferror-invoking-inference-endpoint%2F55971%2F3 "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](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fphilschmid)%5C
**Post date:** [September 22, 2023, 9:01am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Ferror-invoking-inference-endpoint%2F55971%2F4 "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)
