Spaces:
Running
Running
Update app.py
Browse files
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 |
-
|
|
|
|
|
|
|
|
|
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()
|