Update app.py
Browse files
app.py
CHANGED
|
@@ -194,6 +194,7 @@ ClimateGPT harnesses modern OCR techniques to parse and preprocess IPCC reports.
|
|
| 194 |
show_label=False,
|
| 195 |
placeholder="Ask here your climate-related question and press enter",
|
| 196 |
).style(container=False)
|
|
|
|
| 197 |
|
| 198 |
examples_questions = gr.Examples(
|
| 199 |
[
|
|
@@ -230,7 +231,7 @@ ClimateGPT harnesses modern OCR techniques to parse and preprocess IPCC reports.
|
|
| 230 |
"Is the impact of climate change really as severe as it is claimed to be?",
|
| 231 |
"Is climate change a hoax created by the government or environmental organizations?",
|
| 232 |
],
|
| 233 |
-
[
|
| 234 |
)
|
| 235 |
|
| 236 |
with gr.Column(scale=1, variant="panel"):
|
|
@@ -238,22 +239,34 @@ ClimateGPT harnesses modern OCR techniques to parse and preprocess IPCC reports.
|
|
| 238 |
sources_textbox = gr.Textbox(
|
| 239 |
interactive=False, show_label=False, max_lines=50
|
| 240 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 241 |
ask.submit(
|
| 242 |
fn=chat,
|
| 243 |
inputs=[
|
| 244 |
user_id_state,
|
| 245 |
ask,
|
| 246 |
state,
|
| 247 |
-
|
| 248 |
-
["IPCC only", "All available"],
|
| 249 |
-
default="All available",
|
| 250 |
-
label="Select reports",
|
| 251 |
-
),
|
| 252 |
],
|
| 253 |
outputs=[chatbot, state, sources_textbox],
|
| 254 |
)
|
| 255 |
ask.submit(reset_textbox, [], [ask])
|
| 256 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 257 |
gr.Markdown("## How to use ClimateGPT")
|
| 258 |
with gr.Row():
|
| 259 |
with gr.Column(scale=1):
|
|
|
|
| 194 |
show_label=False,
|
| 195 |
placeholder="Ask here your climate-related question and press enter",
|
| 196 |
).style(container=False)
|
| 197 |
+
ask_examples_hidden = gr.Textbox(elem_id = "hidden-message")
|
| 198 |
|
| 199 |
examples_questions = gr.Examples(
|
| 200 |
[
|
|
|
|
| 231 |
"Is the impact of climate change really as severe as it is claimed to be?",
|
| 232 |
"Is climate change a hoax created by the government or environmental organizations?",
|
| 233 |
],
|
| 234 |
+
[ask_examples_hidden],
|
| 235 |
)
|
| 236 |
|
| 237 |
with gr.Column(scale=1, variant="panel"):
|
|
|
|
| 239 |
sources_textbox = gr.Textbox(
|
| 240 |
interactive=False, show_label=False, max_lines=50
|
| 241 |
)
|
| 242 |
+
reports_select = gr.inputs.Dropdown(
|
| 243 |
+
["IPCC only", "All available"],
|
| 244 |
+
default="All available",
|
| 245 |
+
label="Select reports",
|
| 246 |
+
),
|
| 247 |
ask.submit(
|
| 248 |
fn=chat,
|
| 249 |
inputs=[
|
| 250 |
user_id_state,
|
| 251 |
ask,
|
| 252 |
state,
|
| 253 |
+
reports_select
|
|
|
|
|
|
|
|
|
|
|
|
|
| 254 |
],
|
| 255 |
outputs=[chatbot, state, sources_textbox],
|
| 256 |
)
|
| 257 |
ask.submit(reset_textbox, [], [ask])
|
| 258 |
|
| 259 |
+
ask_examples_hidden.change(
|
| 260 |
+
fn=chat,
|
| 261 |
+
inputs=[
|
| 262 |
+
user_id_state,
|
| 263 |
+
ask_examples_hidden,
|
| 264 |
+
state,
|
| 265 |
+
reports_select
|
| 266 |
+
],
|
| 267 |
+
outputs=[chatbot, state, sources_textbox],
|
| 268 |
+
)
|
| 269 |
+
|
| 270 |
gr.Markdown("## How to use ClimateGPT")
|
| 271 |
with gr.Row():
|
| 272 |
with gr.Column(scale=1):
|