# Transformers 4.9.0 on SageMaker

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Ftransformers-4-9-0-on-sagemaker%2F9145%3E%5C
**Category:** Amazon SageMaker\
**Created:** [August 10, 2021, 10:45pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Ftransformers-4-9-0-on-sagemaker%2F9145 "2021-08-10T22:45:13Z")\
**Posts on this page:** 1\
**Showing post:** 9

<div class="post-metadata">

**Author:** ![parasmehta](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/parasmehta/32/4255_2.png) [@parasmehta](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fparasmehta)%5C
**Post date:** [March 23, 2022, 6:57pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Ftransformers-4-9-0-on-sagemaker%2F9145%2F9 "2022-03-23T18:57:46Z")

</div>

Thank you for the pointer @philschmid. In that PR, I noticed that some containers for version `4.17.0` have already been released as mentioned here: [Release v1.0-hf-4.17.0-pt-1.10.2-py38 · aws/deep-learning-containers · GitHub](https://github.com/aws/deep-learning-containers/releases/tag/v1.0-hf-4.17.0-pt-1.10.2-py38)  
This nearly made my day 😃 I tried to use one of these images and run inference on it for ASR using a simple wav file like this:

```auto
from sagemaker.huggingface import HuggingFaceModel
import sagemaker

role = sagemaker.get_execution_role()

# Hub Model configuration. https://huggingface.co/models
hub = {
	'HF_MODEL_ID':'facebook/wav2vec2-xlsr-53-espeak-cv-ft',
	'HF_TASK':'automatic-speech-recognition'
}

# create Hugging Face Model Class
huggingface_model = HuggingFaceModel(
	transformers_version='4.17.0',
	pytorch_version='1.10.2',
	py_version='py38',
    	image_uri='763104351884.dkr.ecr.us-west-2.amazonaws.com/huggingface-pytorch-inference:1.10.2-transformers4.17.0-cpu-py38-ubuntu20.04-v1.0',
    	env=hub,
	role=role, 
)

# deploy model to SageMaker Inference
predictor = huggingface_model.deploy(
	initial_instance_count=1, # number of instances
	instance_type='ml.m5.xlarge' # ec2 instance type
)

result = predictor.predict({"inputs":"audio.wav"})
    
print(result)

```

But the `predict` function throws an Exception:

```auto
ModelError: An error occurred (ModelError) when calling the InvokeEndpoint operation: Received client error (400) from primary with message "{
  "code": 400,
  "type": "InternalServerException",
  "message": "[Errno 2] No such file or directory: \u0027audio.wav\u0027"

```

The `audio.wav` file is in the same folder as the Jupyter notebook. I can’t figure out the reason for this Exception. Any clue what might be going wrong? Thanks!

---

_[View the full topic](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Ftransformers-4-9-0-on-sagemaker%2F9145)._
