Skip to content

Commit

Permalink
Merge pull request #441 from jhj0517/fix/faster-whisper-upgrade
Browse files Browse the repository at this point in the history
Use fixed version of `faster-whisper==1.1.1`
  • Loading branch information
jhj0517 authored Jan 3, 2025
2 parents ad418ca + dbdea98 commit e2fb776
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
4 changes: 3 additions & 1 deletion modules/vad/silero_vad.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ def get_speech_timestamps(
vad_options = VadOptions(**kwargs)

threshold = vad_options.threshold
neg_threshold = vad_options.neg_threshold
min_speech_duration_ms = vad_options.min_speech_duration_ms
max_speech_duration_s = vad_options.max_speech_duration_s
min_silence_duration_ms = vad_options.min_silence_duration_ms
Expand All @@ -117,7 +118,8 @@ def get_speech_timestamps(
triggered = False
speeches = []
current_speech = {}
neg_threshold = vad_options.neg_threshold
if neg_threshold is None:
neg_threshold = max(threshold - 0.15, 0.01)

# to save potential segment end (and tolerate some silence)
temp_end = 0
Expand Down
2 changes: 2 additions & 0 deletions modules/whisper/base_transcription_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,8 @@ def run(self,
segments=result,
speech_chunks=speech_chunks,
)
if not result:
raise ValueError("VAD detected no speech segments in the audio.")

if diarization_params.is_diarize:
result, elapsed_time_diarization = self.diarizer.run(
Expand Down
6 changes: 3 additions & 3 deletions notebook/whisper-webui.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
"!git clone https://github.com/jhj0517/Whisper-WebUI.git\n",
"%cd Whisper-WebUI\n",
"!pip install git+https://github.com/jhj0517/jhj0517-whisper.git\n",
"!pip install git+https://github.com/SYSTRAN/faster-whisper.git\n",
"!pip install faster-whisper==1.1.1\n",
"!pip install ctranslate2==4.4.0\n",
"!pip install gradio\n",
"!pip install gradio-i18n\n",
Expand Down Expand Up @@ -129,12 +129,12 @@
"id": "Qosz9BFlGui3",
"cellView": "form"
},
"execution_count": 4,
"execution_count": null,
"outputs": []
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": null,
"metadata": {
"id": "PQroYRRZzQiN",
"cellView": "form"
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
torch
torchaudio
git+https://github.com/jhj0517/jhj0517-whisper.git
git+https://github.com/SYSTRAN/faster-whisper.git
faster-whisper==1.1.1
transformers
gradio
gradio-i18n
Expand Down

0 comments on commit e2fb776

Please sign in to comment.