dwarkesh commited on
Commit
a7d252b
1 Parent(s): dcc9ea1

output newline fix

Browse files
Files changed (1) hide show
  1. app.py +5 -3
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 == 0 or segments[i - 1]["speaker"] != segment["speaker"]:
86
- output += "\n" + segment["speaker"] + ' ' + str(time(segment["start"])) + '\n'
 
 
87
  output += segment["text"][1:] + ' '
88
- return output[1:]
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',