Update app.py
Browse files
app.py
CHANGED
@@ -77,7 +77,7 @@ examples = [
|
|
77 |
def get_docs(input_query, country = [], vulnerability_cat = []):
|
78 |
if not country:
|
79 |
country = "All Countries"
|
80 |
-
if
|
81 |
if country == "All Countries":
|
82 |
filters = None
|
83 |
else:
|
@@ -141,7 +141,7 @@ def get_prompt(docs, input_query):
|
|
141 |
|
142 |
def run_query(input_text, country, model_sel):
|
143 |
# docs = get_docs(input_text, country)
|
144 |
-
docs = get_docs(input_text, country=country,vulnerability_cat=
|
145 |
# st.write('Selected country: ', country) # Debugging country
|
146 |
if model_sel == "chatGPT":
|
147 |
# res = pipe.run(query=input_text, documents=docs)
|
@@ -164,7 +164,7 @@ def run_query(input_text, country, model_sel):
|
|
164 |
with st.sidebar:
|
165 |
# Dropdown selectbox
|
166 |
country = st.sidebar.multiselect('Filter by country:', country_options)
|
167 |
-
vulnerabilities_cat = st.sidebar.
|
168 |
with st.expander("ℹ️ - About filters", expanded=False):
|
169 |
st.markdown(
|
170 |
"""
|
@@ -195,8 +195,8 @@ with st.expander("ℹ️ - About this app", expanded=False):
|
|
195 |
|
196 |
Make sure your filters match the countries you have specified for the analysis!
|
197 |
""")
|
198 |
-
st.write(country)
|
199 |
-
st.write(vulnerabilities_cat)
|
200 |
|
201 |
|
202 |
# Dropdown selectbox: model
|
|
|
77 |
def get_docs(input_query, country = [], vulnerability_cat = []):
|
78 |
if not country:
|
79 |
country = "All Countries"
|
80 |
+
if not vulnerability_cat:
|
81 |
if country == "All Countries":
|
82 |
filters = None
|
83 |
else:
|
|
|
141 |
|
142 |
def run_query(input_text, country, model_sel):
|
143 |
# docs = get_docs(input_text, country)
|
144 |
+
docs = get_docs(input_text, country=country,vulnerability_cat=vulnerabilities_cat)
|
145 |
# st.write('Selected country: ', country) # Debugging country
|
146 |
if model_sel == "chatGPT":
|
147 |
# res = pipe.run(query=input_text, documents=docs)
|
|
|
164 |
with st.sidebar:
|
165 |
# Dropdown selectbox
|
166 |
country = st.sidebar.multiselect('Filter by country:', country_options)
|
167 |
+
vulnerabilities_cat = st.sidebar.multiselect('Filter by vulnerabilities category:', vulnerability_options)
|
168 |
with st.expander("ℹ️ - About filters", expanded=False):
|
169 |
st.markdown(
|
170 |
"""
|
|
|
195 |
|
196 |
Make sure your filters match the countries you have specified for the analysis!
|
197 |
""")
|
198 |
+
# st.write(country)
|
199 |
+
# st.write(vulnerabilities_cat)
|
200 |
|
201 |
|
202 |
# Dropdown selectbox: model
|