awacke1 commited on
Commit
6a593c5
β€’
1 Parent(s): 276d281

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -16
app.py CHANGED
@@ -17,6 +17,15 @@ 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
  @st.cache(
22
  show_spinner=False,
@@ -124,22 +133,6 @@ model_choice = st.sidebar.selectbox("Similarity model", options=MODEL_OPTIONS)
124
  model_id = 0 if model_choice == MODEL_OPTIONS[0] else 1
125
 
126
 
127
-
128
- #def form_callback():
129
- # st.write(st.session_state.my_slider)
130
- # st.write(st.session_state.my_checkbox)
131
-
132
- if 'query' not in st.session_state:
133
- query = st.text_input("", value="artificial intelligence", key="query")
134
- st.session_state['query'] = 'value'
135
- else:
136
- query = st.text_input("", value=st.session_state["query"], key="query")
137
- st.session_state.query = query
138
-
139
- if 'query' not in st.session_state:
140
- st.session_state.query = 'value'
141
- st.write(st.session_state.query)
142
-
143
  # Session state
144
  if 'key' not in st.session_state:
145
  st.session_state['key'] = 'value'
 
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
+ if 'query' not in st.session_state:
21
+ query = st.text_input("", value="artificial intelligence", key="query")
22
+ st.session_state['query'] = 'value'
23
+ else:
24
+ query = st.text_input("", value=st.session_state["query"], key="query")
25
+ st.session_state.query = query
26
+ if 'query' not in st.session_state:
27
+ st.session_state.query = 'value'
28
+ st.write(st.session_state.query)
29
 
30
  @st.cache(
31
  show_spinner=False,
 
133
  model_id = 0 if model_choice == MODEL_OPTIONS[0] else 1
134
 
135
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
136
  # Session state
137
  if 'key' not in st.session_state:
138
  st.session_state['key'] = 'value'