Spaces:
Build error
Build error
output newline fix
Browse files
app.py
CHANGED
|
@@ -82,10 +82,12 @@ def time(secs):
|
|
| 82 |
def get_output(segments):
|
| 83 |
output = ''
|
| 84 |
for (i, segment) in enumerate(segments):
|
| 85 |
-
if i
|
| 86 |
-
output +=
|
|
|
|
|
|
|
| 87 |
output += segment["text"][1:] + ' '
|
| 88 |
-
return output
|
| 89 |
|
| 90 |
gr.Interface(
|
| 91 |
title = 'Whisper with Speaker Recognition',
|
|
|
|
| 82 |
def get_output(segments):
|
| 83 |
output = ''
|
| 84 |
for (i, segment) in enumerate(segments):
|
| 85 |
+
if i > 0:
|
| 86 |
+
output += '\n\n'
|
| 87 |
+
if segments[i - 1]["speaker"] != segment["speaker"]:
|
| 88 |
+
output += segment["speaker"] + ' ' + str(time(segment["start"])) + '\n'
|
| 89 |
output += segment["text"][1:] + ' '
|
| 90 |
+
return output
|
| 91 |
|
| 92 |
gr.Interface(
|
| 93 |
title = 'Whisper with Speaker Recognition',
|