Update modules/whisper/whisper_base.py
Browse files
modules/whisper/whisper_base.py
CHANGED
|
@@ -214,7 +214,7 @@ class WhisperBase(ABC):
|
|
| 214 |
translate_output: bool = False,
|
| 215 |
translate_model: str = "",
|
| 216 |
target_lang: str = "",
|
| 217 |
-
|
| 218 |
progress=gr.Progress(),
|
| 219 |
*whisper_params,
|
| 220 |
) -> list:
|
|
@@ -238,8 +238,8 @@ class WhisperBase(ABC):
|
|
| 238 |
Translation model to use
|
| 239 |
target_lang: str
|
| 240 |
Target language to use
|
| 241 |
-
|
| 242 |
-
|
| 243 |
progress: gr.Progress
|
| 244 |
Indicator to show progress directly in gradio.
|
| 245 |
*whisper_params: tuple
|
|
@@ -329,7 +329,7 @@ class WhisperBase(ABC):
|
|
| 329 |
file_name, file_ext = os.path.splitext(os.path.basename(file))
|
| 330 |
|
| 331 |
## With or without timestamps
|
| 332 |
-
if
|
| 333 |
subtitle = get_txt(transcribed_segments)
|
| 334 |
else:
|
| 335 |
subtitle = get_plaintext(transcribed_segments)
|
|
|
|
| 214 |
translate_output: bool = False,
|
| 215 |
translate_model: str = "",
|
| 216 |
target_lang: str = "",
|
| 217 |
+
add_timestamp_preview: bool = False,
|
| 218 |
progress=gr.Progress(),
|
| 219 |
*whisper_params,
|
| 220 |
) -> list:
|
|
|
|
| 238 |
Translation model to use
|
| 239 |
target_lang: str
|
| 240 |
Target language to use
|
| 241 |
+
add_timestamp_preview: bool
|
| 242 |
+
Boolean value from gr.Checkbox() that determines whether to add a timestamp to output preview
|
| 243 |
progress: gr.Progress
|
| 244 |
Indicator to show progress directly in gradio.
|
| 245 |
*whisper_params: tuple
|
|
|
|
| 329 |
file_name, file_ext = os.path.splitext(os.path.basename(file))
|
| 330 |
|
| 331 |
## With or without timestamps
|
| 332 |
+
if add_timestamp_preview:
|
| 333 |
subtitle = get_txt(transcribed_segments)
|
| 334 |
else:
|
| 335 |
subtitle = get_plaintext(transcribed_segments)
|