Skip to content

How to get timestamps from SageMaker JumpStart Whisper Large V3 for SRT generation?

0

Question

I’m using the SageMaker JumpStart Whisper Large V3 endpoint (jumpstart-dft-hf-asr-whisper-large-*) to generate SRT subtitles. However, the endpoint only returns the full transcription text without segment or word-level timestamps.

Current Request / Response

Request

{
  "audio_input": "hex_encoded_audio",
  "task": "transcribe",
  "language": "english"
}

Response

{
  "text": "This is the transcribed text"
}

Issue

  • No segments or timestamp information is returned
  • return_timestamps causes a 400 error (“Invalid key”)
  • No timestamp-related parameters are supported

Questions

  1. Does JumpStart Whisper Large V3 support segment or word-level timestamps?
  2. If not, can timestamps be enabled via endpoint customization (e.g., custom inference script)?
  3. What’s the recommended alternative for SRT generation with timestamps?

Environment

  • Model: Whisper Large V3 (JumpStart)
  • Region: us-east-1
  • SDK: boto3 (Python)

asked 10 months ago163 views

2 Answers
0

To address your question about getting timestamps from SageMaker JumpStart Whisper Large V3 for SRT generation:

Based on the available information, the standard JumpStart Whisper Large V3 endpoint doesn't directly support returning segment or word-level timestamps in its default configuration. The default response only includes the transcribed text without timestamp information.

Here are some approaches you might consider:

  1. Use the Format Timestamp transform in SageMaker Unified Studio: If you already have timestamp data that needs formatting, you can use the Format Timestamp transform in a visual ETL job. This allows you to convert timestamp columns into formatted strings suitable for SRT files.

  2. Use the To Timestamp transform: Similarly, if you have timestamp data in a different format, you can use the To Timestamp transform to convert numeric or string columns into proper timestamp format.

  3. Custom deployment with modified inference code: For a more direct solution, you could create a custom deployment of the Whisper model with modified inference code that enables the timestamp functionality. This would involve:

  • Getting the model ID and version information using the SageMaker Python SDK
  • Creating a custom inference script that enables timestamp output
  • Deploying this customized model to your own endpoint

For the custom deployment approach, you would need to:

from sagemaker.jumpstart.session_utils import get_model_info_from_endpoint

model_id, model_version, _, _, _ = get_model_info_from_endpoint(endpoint_name=endpoint_name)

Then you could create a custom inference script that enables the timestamp functionality of the underlying Whisper model and deploy it as a custom model.

If you need a quick solution without customization, you might consider using a different deployment method for Whisper that explicitly supports timestamp output, as the default JumpStart configuration appears to be limited in this regard.
Sources
To timestamp transform - Amazon MaxDome
Format timestamp transform - Amazon MaxDome
Track LLM model evaluation using Amazon SageMaker managed MLflow and FMEval | AWS Machine Learning Blog
Community | Fast Pre-trained Model Deployment - The code only approach

answered 10 months ago

0

Does JumpStart Whisper Large V3 support segment or word-level timestamps?

No, the default JumpStart Whisper Large V3 endpoint does not return timestamps in its current configuration. While the underlying Whisper model natively supports timestamp generation, the JumpStart deployment doesn't expose this functionality through the standard inference parameters.

Can timestamps be enabled via endpoint customization?

Yes, you can enable timestamps through a custom deployment with a modified inference script. However, this requires deploying your own endpoint rather than using the pre-configured JumpStart endpoint. What's the recommended alternative for SRT generation with timestamps?

I recommend considering these options:

Option 1: Amazon Transcribe (Recommended for Production)

  • Provides native word-level timestamps out of the box
  • Built-in support for SRT and VTT subtitle file generation
  • Supports 100+ languages with high accuracy
  • Includes features like custom vocabularies, PII redaction, and speaker identification
  • Purpose-built for transcription workflows

Option 2: Custom SageMaker Deployment

  • Deploy Whisper with a custom inference script that enables the return_timestamps parameter
  • Modify the inference.py to pass timestamp parameters to the underlying Whisper model
  • Provides full control over timestamp granularity (word-level or segment-level)
  • Requires more setup but gives you complete flexibility

Option 3: Alternative Whisper Implementations

  • Consider using enhanced Whisper libraries like WhisperX that provide improved timestamp accuracy specifically for subtitle generation
  • These can be deployed on SageMaker with custom containers

For Your Immediate Use Case:

If you need SRT generation with timestamps, Amazon Transcribe is the most straightforward solution. You can use the StartTranscriptionJob API with SubtitleFormats parameter set to ["srt"] to get properly formatted subtitle files with timestamps automatically.

AWS
SUPPORT ENGINEER

answered 10 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.