How can I use the model for translation from English to French?

#63
by inuwamobarak - opened

I have deployed the whisper model to sagemaker on AWS but I have only been able to do transcription. I have tried different approach but could not achieve translation with my deployment. I used the provided guide to deploy to Sagemaker.

My inference for transcription. How do I modify it for translation tasks?


# AWS SageMaker runtime client
sagemaker_runtime = boto3.client("sagemaker-runtime", region_name="my-region")

# SageMaker endpoint name
ENDPOINT_NAME = ""

# Load an audio file (update with your actual file path)
audio_file_path = "/content/sample_audio.wav"

# Read the audio file as binary
with open(audio_file_path, "rb") as f:
    audio_bytes = f.read()

print("audio_bytes: ", audio_bytes)

# Invoke the endpoint
response = sagemaker_runtime.invoke_endpoint(
    EndpointName=ENDPOINT_NAME,
    ContentType="audio/x-audio",
    Body=audio_bytes,
)

# Decode and print the response
result = response["Body"].read().decode("utf-8")
print("SageMaker Response:", result)

Response:

SageMaker Response: {"text":" This is just a sound sample track to test how this whisper module works. So I'm just recording this to try it out."}

Your need to confirm your account before you can post a new comment.

Sign up or log in to comment