Spaces:
Build error
Build error
camparchimedes
commited on
Commit
•
2920f00
1
Parent(s):
5189387
Update app.py
Browse files
app.py
CHANGED
@@ -29,10 +29,9 @@ def transcribe_audio(audio_file):
|
|
29 |
start_time = time.time()
|
30 |
|
31 |
with torch.no_grad():
|
32 |
-
output = asr(audio_file, chunk_length_s=30, generate_kwargs={"num_beams": 8})
|
33 |
-
|
34 |
transcription = output["text"]
|
35 |
-
|
36 |
end_time = time.time()
|
37 |
output_time = end_time - start_time
|
38 |
word_count = len(transcription.split())
|
@@ -213,13 +212,13 @@ iface = gr.Blocks()
|
|
213 |
|
214 |
with iface:
|
215 |
gr.HTML(banner_html)
|
216 |
-
gr.Markdown("# Vi har nå muligheten til å oversette lydfiler til norsk skrift
|
217 |
|
218 |
with gr.Tabs():
|
219 |
|
220 |
with gr.TabItem("Transcription"):
|
221 |
audio_input = gr.Audio(type="filepath")
|
222 |
-
transcription_output = gr.Textbox(label="Transcription
|
223 |
result_output = gr.Textbox(label="Time taken and Number of words")
|
224 |
transcribe_button = gr.Button("Transcribe")
|
225 |
|
@@ -249,7 +248,7 @@ with iface:
|
|
249 |
outputs=summary_output
|
250 |
)
|
251 |
|
252 |
-
with gr.TabItem("
|
253 |
summary_output = gr.Textbox(label="Summary | LexRank")
|
254 |
summarize_button = gr.Button("Summarize")
|
255 |
|
@@ -265,7 +264,7 @@ with iface:
|
|
265 |
outputs=summary_output
|
266 |
)
|
267 |
|
268 |
-
with gr.TabItem("
|
269 |
summary_output = gr.Textbox(label="Summary | TextRank")
|
270 |
summarize_button = gr.Button("Summarize")
|
271 |
|
@@ -318,3 +317,4 @@ with iface:
|
|
318 |
)
|
319 |
|
320 |
iface.launch(share=True, debug=True)
|
|
|
|
29 |
start_time = time.time()
|
30 |
|
31 |
with torch.no_grad():
|
32 |
+
output = asr(audio_file, chunk_length_s=30, generate_kwargs={"num_beams": 8}) # "task": "transcribe", "language": "no"
|
33 |
+
|
34 |
transcription = output["text"]
|
|
|
35 |
end_time = time.time()
|
36 |
output_time = end_time - start_time
|
37 |
word_count = len(transcription.split())
|
|
|
212 |
|
213 |
with iface:
|
214 |
gr.HTML(banner_html)
|
215 |
+
gr.Markdown("# Vi har nå muligheten til å oversette lydfiler til norsk skrift.")
|
216 |
|
217 |
with gr.Tabs():
|
218 |
|
219 |
with gr.TabItem("Transcription"):
|
220 |
audio_input = gr.Audio(type="filepath")
|
221 |
+
transcription_output = gr.Textbox(label="Transcription")
|
222 |
result_output = gr.Textbox(label="Time taken and Number of words")
|
223 |
transcribe_button = gr.Button("Transcribe")
|
224 |
|
|
|
248 |
outputs=summary_output
|
249 |
)
|
250 |
|
251 |
+
with gr.TabItem("LexRank"):
|
252 |
summary_output = gr.Textbox(label="Summary | LexRank")
|
253 |
summarize_button = gr.Button("Summarize")
|
254 |
|
|
|
264 |
outputs=summary_output
|
265 |
)
|
266 |
|
267 |
+
with gr.TabItem("TextRank"):
|
268 |
summary_output = gr.Textbox(label="Summary | TextRank")
|
269 |
summarize_button = gr.Button("Summarize")
|
270 |
|
|
|
317 |
)
|
318 |
|
319 |
iface.launch(share=True, debug=True)
|
320 |
+
|