Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -130,23 +130,20 @@ with gr.Blocks(title="NLP Toolkit", theme=gr.themes.Soft()) as demo:
|
|
| 130 |
btn_summarize = gr.Button("Generate Summary", variant="primary")
|
| 131 |
btn_summarize.click(fn=summarize_text, inputs=input_long, outputs=output_summary)
|
| 132 |
|
| 133 |
-
|
| 134 |
-
|
| 135 |
-
|
| 136 |
-
|
| 137 |
-
|
| 138 |
-
|
| 139 |
-
|
|
|
|
| 140 |
)
|
| 141 |
|
| 142 |
-
|
| 143 |
-
|
| 144 |
-
|
| 145 |
-
|
| 146 |
-
|
| 147 |
-
example3.click(
|
| 148 |
-
fn=lambda: "Climate change is a long-term shift in global temperatures.",
|
| 149 |
-
outputs=input_long
|
| 150 |
)
|
| 151 |
|
| 152 |
# Create Translation tab
|
|
|
|
| 130 |
btn_summarize = gr.Button("Generate Summary", variant="primary")
|
| 131 |
btn_summarize.click(fn=summarize_text, inputs=input_long, outputs=output_summary)
|
| 132 |
|
| 133 |
+
examples = gr.Dataset(
|
| 134 |
+
components=[input_long],
|
| 135 |
+
samples=[
|
| 136 |
+
["Artificial intelligence is transforming healthcare and transportation."],
|
| 137 |
+
["The James Webb Space Telescope is the largest space telescope ever built."],
|
| 138 |
+
["Climate change is a long-term shift in global temperatures."]
|
| 139 |
+
],
|
| 140 |
+
label="Examples"
|
| 141 |
)
|
| 142 |
|
| 143 |
+
examples.click(
|
| 144 |
+
lambda x: x,
|
| 145 |
+
inputs=[examples],
|
| 146 |
+
outputs=[input_long]
|
|
|
|
|
|
|
|
|
|
|
|
|
| 147 |
)
|
| 148 |
|
| 149 |
# Create Translation tab
|