GuidK commited on
Commit
9686b97
·
verified ·
1 Parent(s): 608cfa1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -15
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
- example1 = gr.Button("AI Example")
134
- example2 = gr.Button("Space Example")
135
- example3 = gr.Button("Climate Example")
136
-
137
- example1.click(
138
- fn=lambda: "Artificial intelligence is transforming healthcare and transportation.",
139
- outputs=input_long
 
140
  )
141
 
142
- example2.click(
143
- fn=lambda: "The James Webb Space Telescope is the largest space telescope ever built.",
144
- outputs=input_long
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