# How to deploy Whisper for other languages to Sagemaker?

**URL:** <https://discuss.huggingface.co/t/how-to-deploy-whisper-for-other-languages-to-sagemaker/71956>\
**Category:** Amazon SageMaker\
**Created:** [February 5, 2024, 3:55pm UTC](https://discuss.huggingface.co/t/how-to-deploy-whisper-for-other-languages-to-sagemaker/71956 "2024-02-05T15:55:27Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![brainer](https://avatars.discourse-cdn.com/v4/letter/b/977dab/32.png) [@brainer](https://discuss.huggingface.co/u/brainer)\
**Post date:** [February 5, 2024, 3:55pm UTC](https://discuss.huggingface.co/t/how-to-deploy-whisper-for-other-languages-to-sagemaker/71956/1 "2024-02-05T15:55:27Z")

</div>

```python
from sagemaker.huggingface.model import HuggingFaceModel
from sagemaker.serverless import ServerlessInferenceConfig
import json

# Hub Model configuration. <https://huggingface.co/models>
hub = {
	'HF_MODEL_ID':'openai/whisper-base',
	'HF_TASK':'automatic-speech-recognition',
}

# create Hugging Face Model Class
huggingface_model = HuggingFaceModel(
	transformers_version='4.26.0',
	pytorch_version='1.13.1',
	py_version='py39',
	env=hub,
	role=role, 
)

# Specify MemorySizeInMB and MaxConcurrency in the serverless config object
serverless_config = ServerlessInferenceConfig(
    memory_size_in_mb=3072, max_concurrency=2,
)

# deploy the endpoint endpoint
predictor = huggingface_model.deploy(
    serverless_inference_config=serverless_config
)

```

I’v tried this too

```python
from transformers import pipeline
import torch

# Assuming you have already defined `device`
device = "cuda" if torch.cuda.is_available() else "cpu"

pipe = pipeline(
  "automatic-speech-recognition",
  model=model,
  tokenizer=tokenizer,
  feature_extractor=ckpt,
  framework="pt",
  device=device,
)

```

but

I’v got error

```auto
ModelError: An error occurred (ModelError) when calling the InvokeEndpoint operation: Received client error (400) from model with message "{
  "code": 400,
  "type": "InternalServerException",
  "message": "Could not load model /.sagemaker/mms/models/brainer__whisper-medium-korean with any of the following classes: (\u003cclass \u0027transformers.models.auto.modeling_auto.AutoModelForCTC\u0027\u003e, \u003cclass \u0027transformers.models.auto.modeling_auto.AutoModelForSpeechSeq2Seq\u0027\u003e, \u003cclass \u0027transformers.models.whisper.modeling_whisper.WhisperForConditionalGeneration\u0027\u003e)."
}

```

How to solve it?
