Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -19,14 +19,13 @@ def get_text_from_url(request: gr.Request):
|
|
| 19 |
input_text = params.get("text", "")
|
| 20 |
return unquote(input_text) # Decode URL-encoded text
|
| 21 |
|
| 22 |
-
#
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
title="Text Summarizer using T5",
|
| 28 |
-
description="Enter your text and generate a concise summary using the T5 model!",
|
| 29 |
-
)
|
| 30 |
|
| 31 |
-
|
| 32 |
-
demo.load(get_text_from_url, outputs=
|
|
|
|
|
|
|
|
|
| 19 |
input_text = params.get("text", "")
|
| 20 |
return unquote(input_text) # Decode URL-encoded text
|
| 21 |
|
| 22 |
+
# Wrap inside a Blocks container
|
| 23 |
+
with gr.Blocks() as demo:
|
| 24 |
+
textbox = gr.Textbox(lines=5, placeholder="Enter text to summarize...")
|
| 25 |
+
output = gr.Textbox(label="Summary")
|
| 26 |
+
button = gr.Button("Summarize")
|
|
|
|
|
|
|
|
|
|
| 27 |
|
| 28 |
+
button.click(summarize_text, inputs=textbox, outputs=output)
|
| 29 |
+
demo.load(get_text_from_url, outputs=textbox) # Now inside Blocks
|
| 30 |
+
|
| 31 |
+
demo.launch()
|