A demo web application that showcases state-of-the-art client-side transcription, with everything running directly in your browser. By leveraging Transformers.js and ONNX Runtime Web, this demo enables WebGPU-accelerated real-time in-browser transcription for Amazon IVS Low-latency and Real-time streams.
Warning
This is an experimental demo designed exclusively for educational purposes. By using this solution, you understand and accept its risks and limitations.
- A WebGPU capable device.
- NodeJS
v20.10.0
and Node package manager (npm).- If you have node version manager installed, run
nvm use
to sync your node version with this project.
- If you have node version manager installed, run
API_URL
from the deployed serverless infrastructure for this demo.- AWS CLI Version 2
- Access to an AWS Account with at least the following permissions:
- Create IAM roles
- Create Lambda Functions
- Create Amazon IVS Stages
- Create Amazon S3 Buckets
- Create Cloudfront Distributions
Follow these instructions to run the demo:
- Initialize the infrastructure:
npm run deploy:init
- Deploy the backend stack:
npm run deploy:backend
For more details, review the Amazon IVS WebGPU Captions Demo Serverless Infrastructure
- Run:
npm ci
- Run:
npm run dev
The following command will deploy the client website to a public cloudfront url.
- Run:
npm run deploy:website
Replace the PLAYBACK_URL
in src/constants.js with your IVS Playback URL.
Modify the SAMPLE_MODELS
in src/constants.js to add or remove the models shown in the UI. Additional models may be found in the Hugging Face ONNX Community.
{
label: 'Model name'
description: 'A short description of the model.',
value: 'huggingface_model_name', // for example, 'onnx-community/whisper-tiny.en'
sizeInBytes: Model size,
modelOptions: {
dtype: {
encoder_model: 'q4', // 'q4' or 'q8' or 'fp16 or 'fp32' (values may not work with all models)
decoder_model_merged: 'q4', // 'q4' or 'q8' or 'fp16 or 'fp32' (values may not work with all models)
},
device: 'webgpu', // or 'wasm'
},
},
- The application is meant for demonstration purposes and not for production use.
- This application is only tested and supported on browsers and devices that support WebGPU. Other browsers and devices, including mobile browsers and smartphones, may work with this tool, but are not officially supported at this time.
- Muting a low-latency video will stop captions from being generated. Real-time videos do not have this issue.
- In some cases, the application may experience a memory leak (seems related to huggingface/transformers.js#860)
Amazon Interactive Video Service (Amazon IVS) is a managed livestreaming and stream chat solution that is quick and easy to set up, and ideal for creating interactive video experiences. Learn more.