Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Leave a message than raising the error #469

Merged
merged 3 commits into from
Jan 22, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Remove error raising when audio is silent
jhj0517 committed Jan 22, 2025
commit 065cc8458b5ec6c93f22381355444f912950d6e5
12 changes: 9 additions & 3 deletions modules/whisper/base_transcription_pipeline.py
Original file line number Diff line number Diff line change
@@ -15,6 +15,7 @@
from modules.utils.paths import (WHISPER_MODELS_DIR, DIARIZATION_MODELS_DIR, OUTPUT_DIR, DEFAULT_PARAMETERS_CONFIG_PATH,
UVR_MODELS_DIR)
from modules.utils.constants import *
from modules.utils.logger import get_gradio_logger
from modules.utils.subtitle_manager import *
from modules.utils.youtube_manager import get_ytdata, get_ytaudio
from modules.utils.files_manager import get_media_files, format_gradio_files, load_yaml, save_yaml, read_file
@@ -23,6 +24,9 @@
from modules.vad.silero_vad import SileroVAD


logger = get_gradio_logger()


class BaseTranscriptionPipeline(ABC):
def __init__(self,
model_dir: str = WHISPER_MODELS_DIR,
@@ -158,12 +162,14 @@ def run(self,
)

if vad_params.vad_filter:
result = self.vad.restore_speech_timestamps(
restored_result = self.vad.restore_speech_timestamps(
segments=result,
speech_chunks=speech_chunks,
)
if not result:
raise ValueError("VAD detected no speech segments in the audio.")
if restored_result:
result = restored_result
else:
logger.info("VAD detected no speech segments in the audio.")

if diarization_params.is_diarize:
result, elapsed_time_diarization = self.diarizer.run(