Sangmin commited on
Commit
2b07e95
1 Parent(s): 202fe0b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -2
app.py CHANGED
@@ -96,8 +96,12 @@ def yt_transcribe(yt_url, task, max_filesize=75.0):
96
  inputs = {"array": inputs, "sampling_rate": pipe.feature_extractor.sampling_rate}
97
 
98
  text = pipe(inputs, batch_size=BATCH_SIZE, generate_kwargs={"task": task}, return_timestamps=True)
99
-
100
- return html_embed_str, text
 
 
 
 
101
 
102
 
103
  demo = gr.Blocks()
 
96
  inputs = {"array": inputs, "sampling_rate": pipe.feature_extractor.sampling_rate}
97
 
98
  text = pipe(inputs, batch_size=BATCH_SIZE, generate_kwargs={"task": task}, return_timestamps=True)
99
+ text = pipe(inputs, batch_size=BATCH_SIZE, generate_kwargs={"task": task}, return_timestamps=return_timestamps)
100
+
101
+ if return_timestamps:
102
+ return html_embed_str, chunks_to_srt(result['chunks'])
103
+ else:
104
+ return html_embed_str, result['text']
105
 
106
 
107
  demo = gr.Blocks()