Spaces:
Runtime error
Runtime error
Commit ·
89a2d08
1
Parent(s): efe7227
add spinner in app.py
Browse files
app.py
CHANGED
|
@@ -37,10 +37,11 @@ def process_data(df, desc, message, embed=False):
|
|
| 37 |
if btn_q :
|
| 38 |
query = [['Represent the question for retrieving supporting documents: ',question]]
|
| 39 |
query_embeddings = model.encode(query)
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
|
|
|
| 44 |
|
| 45 |
|
| 46 |
opt = st.radio("Choose Data : ", ["intent.csv", "upload file CSV"], captions=["LMD CSV intent data", "Custom upload CSV data"])
|
|
|
|
| 37 |
if btn_q :
|
| 38 |
query = [['Represent the question for retrieving supporting documents: ',question]]
|
| 39 |
query_embeddings = model.encode(query)
|
| 40 |
+
|
| 41 |
+
with st.spinner('Wait for it...'):
|
| 42 |
+
similarities = cosine_similarity(query_embeddings,corpus_embeddings)
|
| 43 |
+
retrieved_doc_id = np.argmax(similarities)
|
| 44 |
+
st.markdown(f"{data[retrieved_doc_id][-1]}",unsafe_allow_html=True)
|
| 45 |
|
| 46 |
|
| 47 |
opt = st.radio("Choose Data : ", ["intent.csv", "upload file CSV"], captions=["LMD CSV intent data", "Custom upload CSV data"])
|