Skip to content

Commit 6fdbe62

Browse files
amalgclaude
andcommitted
Add VAD (Voice Activity Detection) support
- Add WHISPER_VAD environment variable to enable Silero VAD - Add WHISPER_VAD_THRESHOLD for speech probability threshold - Add WHISPER_VAD_MIN_SPEECH for minimum speech duration - Add WHISPER_VAD_MIN_SILENCE for minimum silence duration - Add WHISPER_INITIAL_PROMPT for initial transcription prompt - Add GitHub Actions workflow for automated builds - Update documentation with new environment variables 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent e53876e commit 6fdbe62

3 files changed

Lines changed: 79 additions & 0 deletions

File tree

‎.github/workflows/docker-build.yml‎

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
name: Build and Push Docker Image
2+
3+
on:
4+
push:
5+
branches:
6+
- gpu
7+
paths-ignore:
8+
- '**.md'
9+
- 'LICENSE'
10+
pull_request:
11+
branches:
12+
- gpu
13+
schedule:
14+
# Rebuild weekly to get latest wyoming-faster-whisper updates
15+
- cron: '0 4 * * 0'
16+
workflow_dispatch:
17+
18+
env:
19+
REGISTRY: ghcr.io
20+
IMAGE_NAME: ${{ github.repository }}
21+
22+
jobs:
23+
build-and-push:
24+
runs-on: ubuntu-latest
25+
permissions:
26+
contents: read
27+
packages: write
28+
29+
steps:
30+
- name: Checkout repository
31+
uses: actions/checkout@v4
32+
33+
- name: Set up QEMU
34+
uses: docker/setup-qemu-action@v3
35+
36+
- name: Set up Docker Buildx
37+
uses: docker/setup-buildx-action@v3
38+
39+
- name: Log in to Container Registry
40+
if: github.event_name != 'pull_request'
41+
uses: docker/login-action@v3
42+
with:
43+
registry: ${{ env.REGISTRY }}
44+
username: ${{ github.actor }}
45+
password: ${{ secrets.GITHUB_TOKEN }}
46+
47+
- name: Extract metadata
48+
id: meta
49+
uses: docker/metadata-action@v5
50+
with:
51+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
52+
tags: |
53+
type=raw,value=gpu
54+
type=raw,value=latest
55+
type=sha,prefix=gpu-
56+
57+
- name: Build and push Docker image
58+
uses: docker/build-push-action@v5
59+
with:
60+
context: .
61+
push: ${{ github.event_name != 'pull_request' }}
62+
tags: ${{ steps.meta.outputs.tags }}
63+
labels: ${{ steps.meta.outputs.labels }}
64+
cache-from: type=gha
65+
cache-to: type=gha,mode=max
66+
build-args: |
67+
BUILD_DATE=${{ github.event.repository.updated_at }}
68+
VERSION=custom-vad

‎readme-vars.yml‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,11 @@ opt_param_env_vars:
3333
- {env_var: "WHISPER_BEAM", env_value: "1", desc: "Number of candidates to consider simultaneously during transcription."}
3434
- {env_var: "WHISPER_LANG", env_value: "auto", desc: "Two character code for the language that you will speak to the add-on."}
3535
- {env_var: "WHISPER_MODEL", env_value: "auto", desc: "Whisper model that will be used for transcription. From [here](https://github.com/SYSTRAN/faster-whisper/blob/master/faster_whisper/utils.py#L11-L31)."}
36+
- {env_var: "WHISPER_VAD", env_value: "", desc: "Enable Silero VAD (Voice Activity Detection) to filter out non-speech, reducing hallucinations in noisy environments."}
37+
- {env_var: "WHISPER_VAD_THRESHOLD", env_value: "0.5", desc: "VAD speech probability threshold (0.0-1.0). Higher = more strict."}
38+
- {env_var: "WHISPER_VAD_MIN_SPEECH", env_value: "250", desc: "VAD minimum speech duration in milliseconds."}
39+
- {env_var: "WHISPER_VAD_MIN_SILENCE", env_value: "2000", desc: "VAD minimum silence duration in milliseconds to split audio."}
40+
- {env_var: "WHISPER_INITIAL_PROMPT", env_value: "", desc: "Optional text to provide as a prompt for the first transcription window."}
3641
readonly_supported: true
3742
# application setup block
3843
app_setup_block_enabled: true
@@ -85,6 +90,7 @@ init_diagram: |
8590
"faster-whisper:gpu" <- Base Images
8691
# changelog
8792
changelogs:
93+
- {date: "04.02.26:", desc: "Add VAD (Voice Activity Detection) support via WHISPER_VAD* environment variables."}
8894
- {date: "26.01.26:", desc: "Default to `auto` for model and language if not set."}
8995
- {date: "20.08.25:", desc: "Add gpu-legacy branch for pre-Turing cards."}
9096
- {date: "10.08.25:", desc: "Add support for local-only mode."}

‎root/etc/s6-overlay/s6-rc.d/svc-whisper/run‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,10 @@ exec \
1313
--language "${WHISPER_LANG:-auto}" \
1414
--data-dir /config \
1515
--download-dir /config \
16+
${WHISPER_VAD:+--vad-filter} \
17+
${WHISPER_VAD_THRESHOLD:+--vad-threshold ${WHISPER_VAD_THRESHOLD}} \
18+
${WHISPER_VAD_MIN_SPEECH:+--vad-min-speech-ms ${WHISPER_VAD_MIN_SPEECH}} \
19+
${WHISPER_VAD_MIN_SILENCE:+--vad-min-silence-ms ${WHISPER_VAD_MIN_SILENCE}} \
20+
${WHISPER_INITIAL_PROMPT:+--initial-prompt "${WHISPER_INITIAL_PROMPT}"} \
1621
${DEBUG:+--debug} \
1722
${LOCAL_ONLY:+--local-files-only}

0 commit comments

Comments
 (0)