timeki commited on
Commit
0b67ec8
·
1 Parent(s): 899836b

change sample questions

Browse files
app.py CHANGED
@@ -128,7 +128,7 @@ def cqa_tab(tab_name):
128
  with gr.Tabs(elem_id="right_panel_tab") as tabs:
129
  # Examples tab
130
  with gr.TabItem("Examples", elem_id="tab-examples", id=0):
131
- examples_hidden = create_examples_tab()
132
 
133
  # Sources tab
134
  with gr.Tab("Sources", elem_id="tab-sources", id=1) as tab_sources:
 
128
  with gr.Tabs(elem_id="right_panel_tab") as tabs:
129
  # Examples tab
130
  with gr.TabItem("Examples", elem_id="tab-examples", id=0):
131
+ examples_hidden = create_examples_tab(tab_name)
132
 
133
  # Sources tab
134
  with gr.Tab("Sources", elem_id="tab-sources", id=1) as tab_sources:
climateqa/sample_questions.py CHANGED
@@ -101,4 +101,18 @@ QUESTIONS = {
101
  "Is the current technological infrastructure sufficiently advanced and tested to support the implementation of deep-sea mining operations effectively?",
102
  "Provide me with a list of organizations most actively opposing deep-sea mining."
103
  ]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
104
  }
 
101
  "Is the current technological infrastructure sufficiently advanced and tested to support the implementation of deep-sea mining operations effectively?",
102
  "Provide me with a list of organizations most actively opposing deep-sea mining."
103
  ]
104
+ }
105
+
106
+ QUESTIONS_POC = {
107
+ "Popular Questions": [
108
+ "Comment le changement climatique va impacter les parisiens ?",
109
+ "Qu'est ce qui est mis en place à Paris pour lutter contre le changement climatique ?",
110
+ """Quelle est la différence entre l'adaptation et l'atténuation ?""",
111
+ """Qui est responsable de l'adaptation au changement climatique ?""",
112
+ """Quelles sont les "mesures sans regret" pour l'adaptation ?""",
113
+ """Quelles sont les "mesures sans regret" pour l'adaptation qui pourraient être mise en œuvre à Paris ?""",
114
+ "Comment évalue-t-on les vulnérabilités et les risques climatiques à Paris ?",
115
+ "A Paris, quels sont les impacts du changement climatique sur la ressource en eau ?",
116
+ "Quels sont les impacts du changement climatique sur la biodiversité à Paris ?",
117
+ ],
118
  }
front/tabs/tab_examples.py CHANGED
@@ -1,9 +1,10 @@
1
  import gradio as gr
2
- from climateqa.sample_questions import QUESTIONS
3
 
4
 
5
- def create_examples_tab():
6
  examples_hidden = gr.Textbox(visible=False, elem_id=f"examples-hidden")
 
7
  first_key = list(QUESTIONS.keys())[0]
8
  dropdown_samples = gr.Dropdown(
9
  choices=QUESTIONS.keys(),
 
1
  import gradio as gr
2
+ from climateqa.sample_questions import QUESTIONS_GLOBAL, QUESTIONS_POC
3
 
4
 
5
+ def create_examples_tab(tab_name):
6
  examples_hidden = gr.Textbox(visible=False, elem_id=f"examples-hidden")
7
+ QUESTIONS = QUESTIONS_POC if tab_name == "Beta - POC Adapt'Action" else QUESTIONS_GLOBAL
8
  first_key = list(QUESTIONS.keys())[0]
9
  dropdown_samples = gr.Dropdown(
10
  choices=QUESTIONS.keys(),