Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
@@ -17,21 +17,7 @@ DESCRIPTION = """
|
|
17 |
Built with π€ Hugging Face's [transformers](https://huggingface.co/transformers/) library, [SentenceBert](https://www.sbert.net/) models, [Streamlit](https://streamlit.io/) and 44k movie descriptions from the Kaggle [Movies Dataset](https://www.kaggle.com/rounakbanik/the-movies-dataset)
|
18 |
"""
|
19 |
|
20 |
-
|
21 |
-
if 'key' not in st.session_state:
|
22 |
-
st.session_state['key'] = 'value'
|
23 |
-
if 'key' not in st.session_state:
|
24 |
-
st.session_state.key = 'value'
|
25 |
-
st.write(st.session_state.key)
|
26 |
-
st.session_state.key = 'value2' # Attribute API
|
27 |
-
st.session_state['key'] = 'value2' # Dictionary like API
|
28 |
-
st.write(st.session_state)
|
29 |
-
st.session_state
|
30 |
-
for key in st.session_state.keys():
|
31 |
-
del st.session_state[key]
|
32 |
-
|
33 |
-
st.text_input("Your name", key="name")
|
34 |
-
st.session_state.name
|
35 |
|
36 |
#def form_callback():
|
37 |
# st.write(st.session_state.my_slider)
|
@@ -144,12 +130,32 @@ model_id = 0 if model_choice == MODEL_OPTIONS[0] else 1
|
|
144 |
|
145 |
|
146 |
|
147 |
-
if
|
148 |
-
query = st.text_input("", value=st.session_state["query"], key="query")
|
149 |
-
else:
|
150 |
query = st.text_input("", value="artificial intelligence", key="query")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
151 |
|
152 |
-
st.session_state.query
|
153 |
|
154 |
clicked = click_detector(semantic_search(query, model_id))
|
155 |
|
|
|
17 |
Built with π€ Hugging Face's [transformers](https://huggingface.co/transformers/) library, [SentenceBert](https://www.sbert.net/) models, [Streamlit](https://streamlit.io/) and 44k movie descriptions from the Kaggle [Movies Dataset](https://www.kaggle.com/rounakbanik/the-movies-dataset)
|
18 |
"""
|
19 |
|
20 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
21 |
|
22 |
#def form_callback():
|
23 |
# st.write(st.session_state.my_slider)
|
|
|
130 |
|
131 |
|
132 |
|
133 |
+
if 'query' not in st.session_state:
|
|
|
|
|
134 |
query = st.text_input("", value="artificial intelligence", key="query")
|
135 |
+
st.session_state['query'] = query
|
136 |
+
else:
|
137 |
+
query = st.text_input("", value=st.session_state["query"], key="query")
|
138 |
+
st.session_state.query = query
|
139 |
+
st.write(st.session_state.query)
|
140 |
+
|
141 |
+
# Session state
|
142 |
+
if 'key' not in st.session_state:
|
143 |
+
st.session_state['key'] = 'value'
|
144 |
+
if 'key' not in st.session_state:
|
145 |
+
st.session_state.key = 'value'
|
146 |
+
st.write(st.session_state.key)
|
147 |
+
|
148 |
+
st.session_state.key = 'value2' # Attribute API
|
149 |
+
st.session_state['key'] = 'value2' # Dictionary like API
|
150 |
+
|
151 |
+
st.write(st.session_state)
|
152 |
+
|
153 |
+
st.session_state
|
154 |
+
for key in st.session_state.keys():
|
155 |
+
del st.session_state[key]
|
156 |
+
st.text_input("Your name", key="name")
|
157 |
+
st.session_state.name
|
158 |
|
|
|
159 |
|
160 |
clicked = click_detector(semantic_search(query, model_id))
|
161 |
|