Update app.py
Browse files
app.py
CHANGED
|
@@ -14,13 +14,24 @@ def summarize_text(text):
|
|
| 14 |
with gr.Blocks() as demo:
|
| 15 |
gr.Markdown("## Text Summarization Demo")
|
| 16 |
with gr.Row():
|
| 17 |
-
input_text = gr.Textbox(
|
|
|
|
|
|
|
|
|
|
|
|
|
| 18 |
with gr.Row():
|
| 19 |
summarize_button = gr.Button("Summarize", variant="primary")
|
| 20 |
with gr.Row():
|
| 21 |
-
output_text = gr.Textbox(
|
|
|
|
|
|
|
|
|
|
| 22 |
|
| 23 |
-
summarize_button.click(
|
|
|
|
|
|
|
|
|
|
|
|
|
| 24 |
|
| 25 |
if __name__ == "__main__":
|
| 26 |
-
demo.launch(
|
|
|
|
| 14 |
with gr.Blocks() as demo:
|
| 15 |
gr.Markdown("## Text Summarization Demo")
|
| 16 |
with gr.Row():
|
| 17 |
+
input_text = gr.Textbox(
|
| 18 |
+
label="Enter your text here",
|
| 19 |
+
placeholder="Paste your text here...",
|
| 20 |
+
lines=5
|
| 21 |
+
)
|
| 22 |
with gr.Row():
|
| 23 |
summarize_button = gr.Button("Summarize", variant="primary")
|
| 24 |
with gr.Row():
|
| 25 |
+
output_text = gr.Textbox(
|
| 26 |
+
label="Summary",
|
| 27 |
+
lines=4
|
| 28 |
+
)
|
| 29 |
|
| 30 |
+
summarize_button.click(
|
| 31 |
+
fn=summarize_text,
|
| 32 |
+
inputs=input_text,
|
| 33 |
+
outputs=output_text
|
| 34 |
+
)
|
| 35 |
|
| 36 |
if __name__ == "__main__":
|
| 37 |
+
demo.launch()
|