Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -50,6 +50,24 @@ def getSummary(article):
|
|
| 50 |
|
| 51 |
return b
|
| 52 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 53 |
|
| 54 |
with gr.Blocks() as demo:
|
| 55 |
gr.HTML(
|
|
@@ -65,31 +83,7 @@ with gr.Blocks() as demo:
|
|
| 65 |
"""
|
| 66 |
)
|
| 67 |
with gr.Tab('Get a summary from your own mic or audio file'):
|
| 68 |
-
|
| 69 |
-
result_button_transcribe = gr.Button('1. Transcribe')
|
| 70 |
-
output_text_transcribe = gr.Textbox(placeholder='Transcript of the YouTube video.', label='Transcript')
|
| 71 |
-
|
| 72 |
-
result_button_summary = gr.Button('2. Create Summary')
|
| 73 |
-
output_text_summary = gr.Textbox(placeholder='Summary of the YouTube video transcript.', label='Summary')
|
| 74 |
-
|
| 75 |
-
result_button_transcribe.click(getText, inputs=input_text_url, outputs=output_text_transcribe)
|
| 76 |
-
result_button_summary.click(getSummary, inputs=output_text_transcribe, outputs=output_text_summary)
|
| 77 |
-
|
| 78 |
-
# gr.Interface(
|
| 79 |
-
# fn=transcribe,
|
| 80 |
-
# inputs=[
|
| 81 |
-
# gr.inputs.Audio(source="microphone", type="filepath", optional=True),
|
| 82 |
-
# gr.inputs.Audio(source="upload", type="filepath", optional=True),
|
| 83 |
-
# ],
|
| 84 |
-
# outputs="text",
|
| 85 |
-
# layout="horizontal",
|
| 86 |
-
# theme="huggingface",
|
| 87 |
-
# title="Dutch whisper: Summarize Audio",
|
| 88 |
-
# description=(
|
| 89 |
-
# "Transcribe and summarize."
|
| 90 |
-
# ),
|
| 91 |
-
# allow_flagging="never",
|
| 92 |
-
# )
|
| 93 |
with gr.Tab('Summary of Youtube video'):
|
| 94 |
input_text_url = gr.Textbox(placeholder='Youtube video URL', label='URL')
|
| 95 |
result_button_transcribe = gr.Button('1. Transcribe')
|
|
|
|
| 50 |
|
| 51 |
return b
|
| 52 |
|
| 53 |
+
mf_transcribe = gr.Interface(
|
| 54 |
+
fn=transcribe,
|
| 55 |
+
inputs=[
|
| 56 |
+
gr.inputs.Audio(source="microphone", type="filepath", optional=True),
|
| 57 |
+
gr.inputs.Audio(source="upload", type="filepath", optional=True),
|
| 58 |
+
],
|
| 59 |
+
outputs="text",
|
| 60 |
+
layout="horizontal",
|
| 61 |
+
theme="huggingface",
|
| 62 |
+
title="Whisper Demo: Transcribe Audio",
|
| 63 |
+
description=(
|
| 64 |
+
"Transcribe long-form microphone or audio inputs with the click of a button! Demo uses the the fine-tuned"
|
| 65 |
+
f" checkpoint [{MODEL_NAME}](https://huggingface.co/{MODEL_NAME}) and 🤗 Transformers to transcribe audio files"
|
| 66 |
+
" of arbitrary length."
|
| 67 |
+
),
|
| 68 |
+
allow_flagging="never",
|
| 69 |
+
)
|
| 70 |
+
|
| 71 |
|
| 72 |
with gr.Blocks() as demo:
|
| 73 |
gr.HTML(
|
|
|
|
| 83 |
"""
|
| 84 |
)
|
| 85 |
with gr.Tab('Get a summary from your own mic or audio file'):
|
| 86 |
+
mf_transcribe
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 87 |
with gr.Tab('Summary of Youtube video'):
|
| 88 |
input_text_url = gr.Textbox(placeholder='Youtube video URL', label='URL')
|
| 89 |
result_button_transcribe = gr.Button('1. Transcribe')
|