Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
@@ -19,10 +19,25 @@ def get_sessionmaker(search_param):
|
|
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:
|
@@ -30,19 +45,7 @@ try:
|
|
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):
|
41 |
-
if n < 1:
|
42 |
-
return 1
|
43 |
-
return n * factorial(n - 1)
|
44 |
-
#em10 = factorial(10)
|
45 |
-
#em09 = factorial(9) # Returns instantly!
|
46 |
|
47 |
# callback to update query param on selectbox change
|
48 |
def update_params():
|
@@ -62,6 +65,7 @@ except: # catch exception and set query param to predefined value
|
|
62 |
query_params = st.experimental_get_query_params()
|
63 |
query_option = query_params['query'][0]
|
64 |
|
|
|
65 |
# radio button persistance - plan is to hydrate when selected and change url along with textbox and search
|
66 |
options = ["ai", "nlp", "iot", "vr", "genomics", "graph", "cognitive"]
|
67 |
query_params = st.experimental_get_query_params()
|
19 |
search_param = "Star_Trek:_Discovery"
|
20 |
sm= get_sessionmaker(search_param)
|
21 |
|
22 |
+
|
23 |
+
|
24 |
+
# 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."
|
25 |
+
@st.experimental_memo
|
26 |
+
def factorial(n):
|
27 |
+
if n < 1:
|
28 |
+
return 1
|
29 |
+
return n * factorial(n - 1)
|
30 |
+
#em10 = factorial(10)
|
31 |
+
#em09 = factorial(9) # Returns instantly!
|
32 |
+
|
33 |
+
|
34 |
+
|
35 |
# check if here for the first time then set the query
|
36 |
if 'query' not in st.session_state:
|
37 |
#st.session_state['query'] = 'value'
|
38 |
query = st.text_input("", value="artificial intelligence", key="query")
|
39 |
+
#st.session_state.query = 'Genomics'
|
40 |
+
st.write(st.session_state.query)
|
41 |
else:
|
42 |
query = st.text_input("", value=st.session_state["query"], key="query")
|
43 |
try:
|
45 |
except: # catch exception and set query param to predefined value
|
46 |
print("Error cant set after init")
|
47 |
#if 'query' not in st.session_state:
|
|
|
|
|
|
|
|
|
48 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
49 |
|
50 |
# callback to update query param on selectbox change
|
51 |
def update_params():
|
65 |
query_params = st.experimental_get_query_params()
|
66 |
query_option = query_params['query'][0]
|
67 |
|
68 |
+
|
69 |
# radio button persistance - plan is to hydrate when selected and change url along with textbox and search
|
70 |
options = ["ai", "nlp", "iot", "vr", "genomics", "graph", "cognitive"]
|
71 |
query_params = st.experimental_get_query_params()
|