Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -13,13 +13,19 @@ def summary(input):
|
|
| 13 |
# Close any existing Gradio instances (useful for when running the script multiple times in an interactive environment)
|
| 14 |
gr.close_all()
|
| 15 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 16 |
# Create the Gradio interface
|
| 17 |
demo = gr.Interface(
|
| 18 |
fn=summary, # The function to be called for summarization
|
| 19 |
-
inputs=[gr.Textbox(label="Input text to summarize", lines=6)], # Input textbox for the text to be summarized
|
| 20 |
outputs=[gr.Textbox(label="Summarized text", lines=4)], # Output textbox for the summarized text
|
| 21 |
title="Text Summarizer", # Title of the interface
|
| 22 |
-
description="Summarize the text" # Description of the interface
|
|
|
|
| 23 |
)
|
| 24 |
|
| 25 |
# Launch the Gradio interface
|
|
|
|
| 13 |
# Close any existing Gradio instances (useful for when running the script multiple times in an interactive environment)
|
| 14 |
gr.close_all()
|
| 15 |
|
| 16 |
+
# Example text for summarization
|
| 17 |
+
example_text = """Elon Musk is a visionary entrepreneur known for founding and leading multiple groundbreaking companies, including Tesla, SpaceX, Neuralink, and The Boring Company.
|
| 18 |
+
He has played a pivotal role in revolutionizing the electric vehicle industry, advancing space exploration with reusable rockets, and advocating for the development of sustainable energy solutions.
|
| 19 |
+
Musk's ambitious goals, such as colonizing Mars and building a high-speed transportation system, continue to capture the world's attention and inspire innovation across various industries."""
|
| 20 |
+
|
| 21 |
# Create the Gradio interface
|
| 22 |
demo = gr.Interface(
|
| 23 |
fn=summary, # The function to be called for summarization
|
| 24 |
+
inputs=[gr.Textbox(label="Input text to summarize", lines=6, value=example_text)], # Input textbox for the text to be summarized
|
| 25 |
outputs=[gr.Textbox(label="Summarized text", lines=4)], # Output textbox for the summarized text
|
| 26 |
title="Text Summarizer", # Title of the interface
|
| 27 |
+
description="Summarize the text", # Description of the interface
|
| 28 |
+
examples=[[example_text]]
|
| 29 |
)
|
| 30 |
|
| 31 |
# Launch the Gradio interface
|