Commit ·
6b65221
1
Parent(s): 90e17e9
Move configuration to an other pannel
Browse files
app.py
CHANGED
|
@@ -382,6 +382,7 @@ with gr.Blocks(title="Climate Q&A", css_paths=os.getcwd()+ "/style.css", theme=t
|
|
| 382 |
chat_completed_state = gr.State(0)
|
| 383 |
current_graphs = gr.State([])
|
| 384 |
saved_graphs = gr.State({})
|
|
|
|
| 385 |
|
| 386 |
with gr.Tab("ClimateQ&A"):
|
| 387 |
|
|
@@ -442,38 +443,7 @@ with gr.Blocks(title="Climate Q&A", css_paths=os.getcwd()+ "/style.css", theme=t
|
|
| 442 |
sources_textbox = gr.HTML(show_label=False, elem_id="sources-textbox")
|
| 443 |
docs_textbox = gr.State("")
|
| 444 |
|
| 445 |
-
|
| 446 |
-
|
| 447 |
-
# with Modal(visible = False) as config_modal:
|
| 448 |
-
with gr.Tab("Configuration",elem_id = "tab-config",id = 2) as tab_config:
|
| 449 |
-
|
| 450 |
-
gr.Markdown("Reminders: You can talk in any language, ClimateQ&A is multi-lingual!")
|
| 451 |
-
|
| 452 |
-
|
| 453 |
-
dropdown_sources = gr.CheckboxGroup(
|
| 454 |
-
["IPCC", "IPBES","IPOS"],
|
| 455 |
-
label="Select source",
|
| 456 |
-
value=["IPCC"],
|
| 457 |
-
interactive=True,
|
| 458 |
-
)
|
| 459 |
-
|
| 460 |
-
dropdown_reports = gr.Dropdown(
|
| 461 |
-
POSSIBLE_REPORTS,
|
| 462 |
-
label="Or select specific reports",
|
| 463 |
-
multiselect=True,
|
| 464 |
-
value=None,
|
| 465 |
-
interactive=True,
|
| 466 |
-
)
|
| 467 |
-
|
| 468 |
-
dropdown_audience = gr.Dropdown(
|
| 469 |
-
["Children","General public","Experts"],
|
| 470 |
-
label="Select audience",
|
| 471 |
-
value="Experts",
|
| 472 |
-
interactive=True,
|
| 473 |
-
)
|
| 474 |
-
|
| 475 |
-
output_query = gr.Textbox(label="Query used for retrieval",show_label = True,elem_id = "reformulated-query",lines = 2,interactive = False)
|
| 476 |
-
output_language = gr.Textbox(label="Language",show_label = True,elem_id = "language",lines = 1,interactive = False)
|
| 477 |
|
| 478 |
with gr.Tab("Figures",elem_id = "tab-figures",id = 3) as tab_figures:
|
| 479 |
with Modal(visible=False, elem_id="modal_figure_galery") as modal:
|
|
@@ -521,7 +491,35 @@ with gr.Blocks(title="Climate Q&A", css_paths=os.getcwd()+ "/style.css", theme=t
|
|
| 521 |
# [saved_graphs, save_btn]
|
| 522 |
# )
|
| 523 |
|
| 524 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 525 |
|
| 526 |
|
| 527 |
|
|
@@ -617,7 +615,11 @@ with gr.Blocks(title="Climate Q&A", css_paths=os.getcwd()+ "/style.css", theme=t
|
|
| 617 |
with gr.Row():
|
| 618 |
with gr.Column(scale=1):
|
| 619 |
gr.Markdown("See more info at [https://climateqa.com](https://climateqa.com/docs/intro/)")
|
|
|
|
|
|
|
|
|
|
| 620 |
|
|
|
|
| 621 |
|
| 622 |
def start_chat(query,history):
|
| 623 |
# history = history + [(query,None)]
|
|
|
|
| 382 |
chat_completed_state = gr.State(0)
|
| 383 |
current_graphs = gr.State([])
|
| 384 |
saved_graphs = gr.State({})
|
| 385 |
+
|
| 386 |
|
| 387 |
with gr.Tab("ClimateQ&A"):
|
| 388 |
|
|
|
|
| 443 |
sources_textbox = gr.HTML(show_label=False, elem_id="sources-textbox")
|
| 444 |
docs_textbox = gr.State("")
|
| 445 |
|
| 446 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 447 |
|
| 448 |
with gr.Tab("Figures",elem_id = "tab-figures",id = 3) as tab_figures:
|
| 449 |
with Modal(visible=False, elem_id="modal_figure_galery") as modal:
|
|
|
|
| 491 |
# [saved_graphs, save_btn]
|
| 492 |
# )
|
| 493 |
|
| 494 |
+
|
| 495 |
+
with gr.Tab("Configuration") as tab_config:
|
| 496 |
+
gr.Markdown("Reminders: You can talk in any language, ClimateQ&A is multi-lingual!")
|
| 497 |
+
|
| 498 |
+
|
| 499 |
+
dropdown_sources = gr.CheckboxGroup(
|
| 500 |
+
["IPCC", "IPBES","IPOS"],
|
| 501 |
+
label="Select source",
|
| 502 |
+
value=["IPCC"],
|
| 503 |
+
interactive=True,
|
| 504 |
+
)
|
| 505 |
+
|
| 506 |
+
dropdown_reports = gr.Dropdown(
|
| 507 |
+
POSSIBLE_REPORTS,
|
| 508 |
+
label="Or select specific reports",
|
| 509 |
+
multiselect=True,
|
| 510 |
+
value=None,
|
| 511 |
+
interactive=True,
|
| 512 |
+
)
|
| 513 |
+
|
| 514 |
+
dropdown_audience = gr.Dropdown(
|
| 515 |
+
["Children","General public","Experts"],
|
| 516 |
+
label="Select audience",
|
| 517 |
+
value="Experts",
|
| 518 |
+
interactive=True,
|
| 519 |
+
)
|
| 520 |
+
|
| 521 |
+
output_query = gr.Textbox(label="Query used for retrieval",show_label = True,elem_id = "reformulated-query",lines = 2,interactive = False)
|
| 522 |
+
output_language = gr.Textbox(label="Language",show_label = True,elem_id = "language",lines = 1,interactive = False)
|
| 523 |
|
| 524 |
|
| 525 |
|
|
|
|
| 615 |
with gr.Row():
|
| 616 |
with gr.Column(scale=1):
|
| 617 |
gr.Markdown("See more info at [https://climateqa.com](https://climateqa.com/docs/intro/)")
|
| 618 |
+
|
| 619 |
+
|
| 620 |
+
|
| 621 |
|
| 622 |
+
# config_button = gr.Button("Configuration",elem_id="config-button",interactive=True)
|
| 623 |
|
| 624 |
def start_chat(query,history):
|
| 625 |
# history = history + [(query,None)]
|