I have been trying to deploy the Fairseq MMS model onto AWS Sagemaker and I keep running into error code: 500 when trying to predict the asr for an audio file.
The detailed error:
An error occurred (ModelError) when calling the InvokeEndpoint operation: Received server error (500) from primary with message "{
"code": 500,
"type": "InternalServerException",
"message": "Worker died."
}
My driver code:
# initialize model
huggingface_model = HuggingFaceModel(
transformers_version='4.26.0',
pytorch_version='1.13.1',
py_version='py39',
env=hub,
role=role,
)
# deploy model
predictor = huggingface_model.deploy(
initial_instance_count=1, # number of instances
instance_type='ml.m5.xlarge' # ec2 instance type
)
# add serializer for audio files
predictor.serializer = DataSerializer(content_type='audio/x-audio')
audio_path="test.flac"
# read audio file
with open("test.flac", "rb") as f:
data = f.read()
#transcribe
predictor.predict(data)
The error occurs at predictor.predict(data)