Spaces:
Running
Running
jhj0517
commited on
Commit
·
dbca1ee
1
Parent(s):
b22babf
Refactor parameters
Browse files
modules/whisper/whisper_base.py
CHANGED
|
@@ -104,7 +104,9 @@ class WhisperBase(ABC):
|
|
| 104 |
add_timestamp=add_timestamp
|
| 105 |
)
|
| 106 |
|
| 107 |
-
if params.lang
|
|
|
|
|
|
|
| 108 |
params.lang = None
|
| 109 |
else:
|
| 110 |
language_code_dict = {value: key for key, value in whisper.tokenizer.LANGUAGES.items()}
|
|
@@ -208,6 +210,9 @@ class WhisperBase(ABC):
|
|
| 208 |
try:
|
| 209 |
if input_folder_path:
|
| 210 |
files = get_media_files(input_folder_path)
|
|
|
|
|
|
|
|
|
|
| 211 |
files = format_gradio_files(files)
|
| 212 |
|
| 213 |
files_info = {}
|
|
|
|
| 104 |
add_timestamp=add_timestamp
|
| 105 |
)
|
| 106 |
|
| 107 |
+
if params.lang is None:
|
| 108 |
+
pass
|
| 109 |
+
elif params.lang == "Automatic Detection":
|
| 110 |
params.lang = None
|
| 111 |
else:
|
| 112 |
language_code_dict = {value: key for key, value in whisper.tokenizer.LANGUAGES.items()}
|
|
|
|
| 210 |
try:
|
| 211 |
if input_folder_path:
|
| 212 |
files = get_media_files(input_folder_path)
|
| 213 |
+
if isinstance(files, str):
|
| 214 |
+
files = [files]
|
| 215 |
+
if files and not isinstance(files[0], gr.utils.NamedString):
|
| 216 |
files = format_gradio_files(files)
|
| 217 |
|
| 218 |
files_info = {}
|