Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
@@ -19,6 +19,22 @@ def get_sessionmaker(search_param):
|
|
19 |
search_param = "Star_Trek:_Discovery"
|
20 |
sm= get_sessionmaker(search_param)
|
21 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
22 |
# What is supercool about the second prim the memo is it makes unwieldy data very wieldy. Like the Lord of Rings in reverse re "you cannot wield it! none of us can." -> "You can wield it, now everyone can."
|
23 |
@st.experimental_memo
|
24 |
def factorial(n):
|
@@ -63,20 +79,6 @@ selected_option = st.radio(
|
|
63 |
# set query param based on selection
|
64 |
st.experimental_set_query_params(option=selected_option)
|
65 |
|
66 |
-
# check if here for the first time then set the query
|
67 |
-
if 'query' not in st.session_state:
|
68 |
-
#st.session_state['query'] = 'value'
|
69 |
-
query = st.text_input("", value="artificial intelligence", key="query")
|
70 |
-
else:
|
71 |
-
query = st.text_input("", value=st.session_state["query"], key="query")
|
72 |
-
try:
|
73 |
-
st.session_state.query = query # if set already above. this prevents two interface elements setting it first time once
|
74 |
-
except: # catch exception and set query param to predefined value
|
75 |
-
print("Error cant set after init")
|
76 |
-
#if 'query' not in st.session_state:
|
77 |
-
# st.session_state.query = 'Genomics'
|
78 |
-
st.write(st.session_state.query)
|
79 |
-
|
80 |
|
81 |
|
82 |
|
|
|
19 |
search_param = "Star_Trek:_Discovery"
|
20 |
sm= get_sessionmaker(search_param)
|
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'] = 'value'
|
25 |
+
query = st.text_input("", value="artificial intelligence", key="query")
|
26 |
+
else:
|
27 |
+
query = st.text_input("", value=st.session_state["query"], key="query")
|
28 |
+
try:
|
29 |
+
st.session_state.query = query # if set already above. this prevents two interface elements setting it first time once
|
30 |
+
except: # catch exception and set query param to predefined value
|
31 |
+
print("Error cant set after init")
|
32 |
+
#if 'query' not in st.session_state:
|
33 |
+
# st.session_state.query = 'Genomics'
|
34 |
+
st.write(st.session_state.query)
|
35 |
+
|
36 |
+
|
37 |
+
|
38 |
# What is supercool about the second prim the memo is it makes unwieldy data very wieldy. Like the Lord of Rings in reverse re "you cannot wield it! none of us can." -> "You can wield it, now everyone can."
|
39 |
@st.experimental_memo
|
40 |
def factorial(n):
|
|
|
79 |
# set query param based on selection
|
80 |
st.experimental_set_query_params(option=selected_option)
|
81 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
82 |
|
83 |
|
84 |
|