Update modules/whisper/faster_whisper_inference.py
Browse files
modules/whisper/faster_whisper_inference.py
CHANGED
|
@@ -13,11 +13,10 @@ import gradio as gr
|
|
| 13 |
from argparse import Namespace
|
| 14 |
|
| 15 |
from modules.utils.paths import (FASTER_WHISPER_MODELS_DIR, DIARIZATION_MODELS_DIR, UVR_MODELS_DIR, OUTPUT_DIR)
|
| 16 |
-
from modules.whisper.
|
| 17 |
-
from modules.whisper.
|
| 18 |
|
| 19 |
-
|
| 20 |
-
class FasterWhisperInference(BaseTranscriptionPipeline):
|
| 21 |
def __init__(self,
|
| 22 |
model_dir: str = FASTER_WHISPER_MODELS_DIR,
|
| 23 |
diarization_model_dir: str = DIARIZATION_MODELS_DIR,
|
|
@@ -98,11 +97,11 @@ class FasterWhisperInference(BaseTranscriptionPipeline):
|
|
| 98 |
language_detection_segments=params.language_detection_segments,
|
| 99 |
prompt_reset_on_temperature=params.prompt_reset_on_temperature,
|
| 100 |
)
|
| 101 |
-
progress(0, desc="Loading audio
|
| 102 |
|
| 103 |
segments_result = []
|
| 104 |
for segment in segments:
|
| 105 |
-
progress(segment.start / info.duration, desc="Transcribing
|
| 106 |
segments_result.append(Segment.from_faster_whisper(segment))
|
| 107 |
|
| 108 |
elapsed_time = time.time() - start_time
|
|
@@ -127,7 +126,7 @@ class FasterWhisperInference(BaseTranscriptionPipeline):
|
|
| 127 |
progress: gr.Progress
|
| 128 |
Indicator to show progress directly in gradio.
|
| 129 |
"""
|
| 130 |
-
progress(0, desc="Initializing Model
|
| 131 |
|
| 132 |
model_size_dirname = model_size.replace("/", "--") if "/" in model_size else model_size
|
| 133 |
if model_size not in self.model_paths and model_size_dirname not in self.model_paths:
|
|
|
|
| 13 |
from argparse import Namespace
|
| 14 |
|
| 15 |
from modules.utils.paths import (FASTER_WHISPER_MODELS_DIR, DIARIZATION_MODELS_DIR, UVR_MODELS_DIR, OUTPUT_DIR)
|
| 16 |
+
from modules.whisper.whisper_parameter import *
|
| 17 |
+
from modules.whisper.whisper_base import WhisperBase
|
| 18 |
|
| 19 |
+
class FasterWhisperInference(WhisperBase):
|
|
|
|
| 20 |
def __init__(self,
|
| 21 |
model_dir: str = FASTER_WHISPER_MODELS_DIR,
|
| 22 |
diarization_model_dir: str = DIARIZATION_MODELS_DIR,
|
|
|
|
| 97 |
language_detection_segments=params.language_detection_segments,
|
| 98 |
prompt_reset_on_temperature=params.prompt_reset_on_temperature,
|
| 99 |
)
|
| 100 |
+
progress(0, desc="Loading audio...")
|
| 101 |
|
| 102 |
segments_result = []
|
| 103 |
for segment in segments:
|
| 104 |
+
progress(segment.start / info.duration, desc="Transcribing...")
|
| 105 |
segments_result.append(Segment.from_faster_whisper(segment))
|
| 106 |
|
| 107 |
elapsed_time = time.time() - start_time
|
|
|
|
| 126 |
progress: gr.Progress
|
| 127 |
Indicator to show progress directly in gradio.
|
| 128 |
"""
|
| 129 |
+
progress(0, desc="Initializing Model...")
|
| 130 |
|
| 131 |
model_size_dirname = model_size.replace("/", "--") if "/" in model_size else model_size
|
| 132 |
if model_size not in self.model_paths and model_size_dirname not in self.model_paths:
|