Spaces:
Running
Running
jhj0517
commited on
Commit
·
b5a97f3
1
Parent(s):
9a220cb
upgrade gradio & add comment
Browse files- README.md +1 -1
- modules/whisper/whisper_base.py +4 -0
README.md
CHANGED
|
@@ -4,7 +4,7 @@ emoji: 🚀
|
|
| 4 |
colorFrom: green
|
| 5 |
colorTo: blue
|
| 6 |
sdk: gradio
|
| 7 |
-
sdk_version: 4.
|
| 8 |
app_file: app.py
|
| 9 |
pinned: false
|
| 10 |
license: apache-2.0
|
|
|
|
| 4 |
colorFrom: green
|
| 5 |
colorTo: blue
|
| 6 |
sdk: gradio
|
| 7 |
+
sdk_version: 4.37.2
|
| 8 |
app_file: app.py
|
| 9 |
pinned: false
|
| 10 |
license: apache-2.0
|
modules/whisper/whisper_base.py
CHANGED
|
@@ -156,14 +156,17 @@ class WhisperBase(ABC):
|
|
| 156 |
result_file_path:
|
| 157 |
Output file path to return to gr.Files()
|
| 158 |
"""
|
|
|
|
| 159 |
try:
|
| 160 |
files_info = {}
|
| 161 |
for file in files:
|
|
|
|
| 162 |
transcribed_segments, time_for_task = self.run(
|
| 163 |
file.name,
|
| 164 |
progress,
|
| 165 |
*whisper_params,
|
| 166 |
)
|
|
|
|
| 167 |
|
| 168 |
file_name, file_ext = os.path.splitext(os.path.basename(file.name))
|
| 169 |
file_name = safe_filename(file_name)
|
|
@@ -174,6 +177,7 @@ class WhisperBase(ABC):
|
|
| 174 |
file_format=file_format,
|
| 175 |
output_dir=self.output_dir
|
| 176 |
)
|
|
|
|
| 177 |
files_info[file_name] = {"subtitle": subtitle, "time_for_task": time_for_task, "path": file_path}
|
| 178 |
|
| 179 |
total_result = ''
|
|
|
|
| 156 |
result_file_path:
|
| 157 |
Output file path to return to gr.Files()
|
| 158 |
"""
|
| 159 |
+
print("transcrption started: ")
|
| 160 |
try:
|
| 161 |
files_info = {}
|
| 162 |
for file in files:
|
| 163 |
+
print("run started: ")
|
| 164 |
transcribed_segments, time_for_task = self.run(
|
| 165 |
file.name,
|
| 166 |
progress,
|
| 167 |
*whisper_params,
|
| 168 |
)
|
| 169 |
+
print("run finished: ")
|
| 170 |
|
| 171 |
file_name, file_ext = os.path.splitext(os.path.basename(file.name))
|
| 172 |
file_name = safe_filename(file_name)
|
|
|
|
| 177 |
file_format=file_format,
|
| 178 |
output_dir=self.output_dir
|
| 179 |
)
|
| 180 |
+
print("generated sub finished: ")
|
| 181 |
files_info[file_name] = {"subtitle": subtitle, "time_for_task": time_for_task, "path": file_path}
|
| 182 |
|
| 183 |
total_result = ''
|