Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
@@ -58,15 +58,6 @@ selected_option = st.radio(
|
|
58 |
st.experimental_set_query_params(option=selected_option)
|
59 |
|
60 |
|
61 |
-
|
62 |
-
DEVICE = "cpu"
|
63 |
-
MODEL_OPTIONS = ["msmarco-distilbert-base-tas-b", "all-mpnet-base-v2"]
|
64 |
-
DESCRIPTION = """
|
65 |
-
# Semantic search
|
66 |
-
**Enter your query and hit enter**
|
67 |
-
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)
|
68 |
-
"""
|
69 |
-
|
70 |
try:
|
71 |
query_params = st.experimental_get_query_params()
|
72 |
query_option = query_params['query'][0] #throws an exception when visiting http://host:port
|
@@ -81,12 +72,25 @@ if 'query' not in st.session_state:
|
|
81 |
query = st.text_input("", value="artificial intelligence", key="query")
|
82 |
else:
|
83 |
query = st.text_input("", value=st.session_state["query"], key="query")
|
84 |
-
|
85 |
if 'query' not in st.session_state:
|
86 |
-
st.session_state.query = '
|
87 |
st.write(st.session_state.query)
|
88 |
|
89 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
90 |
# Session state
|
91 |
if 'key' not in st.session_state:
|
92 |
st.session_state['key'] = 'value'
|
|
|
58 |
st.experimental_set_query_params(option=selected_option)
|
59 |
|
60 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
61 |
try:
|
62 |
query_params = st.experimental_get_query_params()
|
63 |
query_option = query_params['query'][0] #throws an exception when visiting http://host:port
|
|
|
72 |
query = st.text_input("", value="artificial intelligence", key="query")
|
73 |
else:
|
74 |
query = st.text_input("", value=st.session_state["query"], key="query")
|
75 |
+
st.session_state.query = query
|
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 |
+
|
83 |
+
|
84 |
+
DEVICE = "cpu"
|
85 |
+
MODEL_OPTIONS = ["msmarco-distilbert-base-tas-b", "all-mpnet-base-v2"]
|
86 |
+
DESCRIPTION = """
|
87 |
+
# Semantic search
|
88 |
+
**Enter your query and hit enter**
|
89 |
+
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)
|
90 |
+
"""
|
91 |
+
|
92 |
+
|
93 |
+
|
94 |
# Session state
|
95 |
if 'key' not in st.session_state:
|
96 |
st.session_state['key'] = 'value'
|