Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
@@ -14,19 +14,20 @@ from st_click_detector import click_detector
|
|
14 |
# callback to update query param on selectbox change
|
15 |
def update_params():
|
16 |
print("update1")
|
17 |
-
try:
|
18 |
-
|
19 |
-
except ValueError:
|
20 |
-
|
21 |
|
22 |
# check if here for the first time then set the query
|
23 |
if 'query' not in st.session_state:
|
24 |
-
st.session_state['query'] = 'AI'
|
25 |
query = st.text_input("", value="AI", key="query")
|
26 |
#st.session_state.query = 'AI'
|
27 |
st.write(st.session_state.query)
|
28 |
else:
|
29 |
query = st.text_input("", value=st.session_state["query"], key="query")
|
|
|
30 |
try:
|
31 |
st.session_state.query = query # if set already above. this prevents two interface elements setting it first time once
|
32 |
except: # catch exception and set query param to predefined value
|
|
|
14 |
# callback to update query param on selectbox change
|
15 |
def update_params():
|
16 |
print("update1")
|
17 |
+
#try:
|
18 |
+
# st.experimental_set_query_params(option=st.session_state.query)
|
19 |
+
#except ValueError:
|
20 |
+
# pass
|
21 |
|
22 |
# check if here for the first time then set the query
|
23 |
if 'query' not in st.session_state:
|
24 |
+
#st.session_state['query'] = 'AI'
|
25 |
query = st.text_input("", value="AI", key="query")
|
26 |
#st.session_state.query = 'AI'
|
27 |
st.write(st.session_state.query)
|
28 |
else:
|
29 |
query = st.text_input("", value=st.session_state["query"], key="query")
|
30 |
+
|
31 |
try:
|
32 |
st.session_state.query = query # if set already above. this prevents two interface elements setting it first time once
|
33 |
except: # catch exception and set query param to predefined value
|