{"id":25776961,"url":"https://github.com/fourTheorem/podwhisperer","last_synced_at":"2025-02-27T06:07:03.782Z","repository":{"id":75385237,"uuid":"557561127","full_name":"fourTheorem/podwhisperer","owner":"fourTheorem","description":"Pod transcription with OpenAI Whisper and AWS","archived":false,"fork":false,"pushed_at":"2024-02-01T15:10:17.000Z","size":1497,"stargazers_count":62,"open_issues_count":4,"forks_count":15,"subscribers_count":6,"default_branch":"main","last_synced_at":"2024-04-13T16:08:09.490Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fourTheorem.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2022-10-25T22:50:37.000Z","updated_at":"2024-04-05T21:43:35.000Z","dependencies_parsed_at":"2023-11-06T12:29:54.501Z","dependency_job_id":null,"html_url":"https://github.com/fourTheorem/podwhisperer","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fourTheorem%2Fpodwhisperer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fourTheorem%2Fpodwhisperer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fourTheorem%2Fpodwhisperer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fourTheorem%2Fpodwhisperer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fourTheorem","download_url":"https://codeload.github.com/fourTheorem/podwhisperer/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240987435,"owners_count":19889335,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-02-27T06:01:33.467Z","updated_at":"2025-02-27T06:07:03.767Z","avatar_url":"https://github.com/fourTheorem.png","language":"TypeScript","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"readme":"# 🎙👂 podwhisperer\n\nA completely automated podcast audio transcription workflow with super accurate results!\n\n\u003e **Note**: this project was presented in [AWS Bites](https://awsbites.com/) Podcast. [Check out the full episode](https://awsbites.com/63-how-to-automate-transcripts-with-amazon-transcribe-and-openai-whisper/)! 👈\n\nThis project uses:\n\n- [OpenAI Whisper](https://github.com/openai/whisper) for super accurate transcription\n- [Amazon Transcribe](https://aws.amazon.com/transcribe/) to add speaker identification\n- [FFmpeg](https://ffmpeg.org/) for audio transcoding to MP3\n- AWS Lambda for:\n  - Merging the Whisper and Transcribe results\n  - Substituting commonly 'misheard' words/proper nouns\n- ...and Step Functions to orchestrate the whole process!\n\nThis project consists of a few components, each with their own CloudFormation Stack:\n\n1. 👂 [whisper-image](./whisper-image), for creating an ECR container image repository where we store the SageMaker container to run the Whisper model\n2. 🪣 [data-resources](./data-resources) for shared data stores, namely an S3 Bucket\n3. 🧠 [sagemaker-resources](./sagemaker-resources) for the SageMaker model and IAM role\n4. 🎙 [transcript-orchestration](./transcript-orchestration), for orchestration and transcript merging \n\nThis project uses AWS SAM with nested stacks to deploy all but the first of these components. That first component is special, since we need to create the container image respository with [Amazon ECR](https://aws.amazon.com/ecr/) where we can push our custom Whisper container image. That makes the image available to be loaded by the SageMaker resources we can then create.\n\n## Prerequisites\n\nYou will need the following build tooling installed.\n- Node.js 18.x and NPM 8.x\n- Docker, or other tooling that can build a container image from a `Dockerfile` and push it to a repository.\n- [AWS SAM](https://aws.amazon.com/serverless/sam/), used to build and deploy most of the application\n- The [AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html)\n- esbuild\n- SLIC Watch: By default, the target AWS account should have the [SLIC Watch](https://github.com/fourTheorem/slic-watch) SAR Application installed. It can be installed by going to _[this page](https://serverlessrepo.aws.amazon.com/applications/eu-west-1/949339270388/slic-watch-app) in the AWS Console. SLIC Watch is used to create alarms and dashboards for our transcription application. If you want to skip this option, just remove the single line referring to the `SlicWatch-v2` macro from the relevant template, [transcript-orchestration/template.yaml](https://github.com/fourTheorem/podwhisperer/blob/cc73c5d4d52dc01f2249a032a9e2186012e24201/transcript-orchestration/template.yaml#L4).\n\n\n## Getting Started\n\nYou can deploy this complete application to your own AWS account.\n\n1. Make sure to set the environment variables for the AWS region and profile\n\n   ```bash\n   export AWS_PROFILE=xxx\n   export AWS_DEFAULT_REGION=eu-central-1\n   export AWS_ACCOUNT_ID=$(aws sts get-caller-identity --query Account --output text)\n   ```\n\n2. The first deployment step creates the ECR repository. We can use the AWS CLI to do this with CloudFormation:\n\n   ```bash\n   aws cloudformation deploy \\\n    --template ./whisper-image/template.yaml \\\n    --stack-name whisper-image \\\n    --tags file://./common-tags.json \\\n    --capabilities CAPABILITY_NAMED_IAM \n   ```\n\n   We can now retrieve the repostiory URI from the CloudFormation outputs:\n\n   ```bash\n   REPOSITORY_URI=$(aws cloudformation describe-stacks --stack-name whisper-image --query \"Stacks[0].Outputs[?ExportName=='whisper-model-image-repository-uri'].OutputValue\" --output text)\n   ```\n\n3. Next, we can build and push the Whisper container image:\n\n   ```bash\n   cd whisper-image\n\n   # Build the container image\n   docker build --platform linux/amd64 -t $REPOSITORY_URI .\n\n   # Log in to ECR with Docker (make sure to set AWS_REGION and AWS_ACCCOUNT_ID)\n   aws ecr get-login-password | docker login --username AWS --password-stdin $AWS_ACCOUNT_ID.dkr.ecr.$AWS_DEFAULT_REGION.amazonaws.com\n\n   # Push the container image to ECR\n   docker push $REPOSITORY_URI\n\n   # leave directory before executing next step\n   cd ..\n   ```\n\n4. Now that our container image is present, we can deploy the rest of the application with AWS SAM.\n\n   ```bash\n   sam build --parallel\n   sam deploy --guided --capabilities CAPABILITY_AUTO_EXPAND CAPABILITY_IAM  # It should be sufficient to accept all defaults when prompted\n   ```\n\nThat's it! You can now test the entire transcription flow. The entire process is trigged when you upload an audio file to the newly-created S3 Bucket:\n\n```bash\naws s3 cp sample-audio/sample1.mp3 s3://pod-transcription-${AWS_ACCOUNT_ID}-${AWS_REGION}/audio/sample1.mp3\n```\n\nThat S3 object upload will create an EventBridge event to trigger the transcription Step Function. You can watch its progress in the Step Functions Console.\n\n### Step function architecture\n\nTo have a better feeling for what the process looks like you can check out the following picture for a visualization of the Step Function definition:\n\n[![Overview of the step function](/docs/step-function-overview.png)](/docs/step-function-overview.png)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FfourTheorem%2Fpodwhisperer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FfourTheorem%2Fpodwhisperer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FfourTheorem%2Fpodwhisperer/lists"}