Update app.py
Browse files
app.py
CHANGED
@@ -87,10 +87,11 @@ with st.form(key='my_form'):
|
|
87 |
submit_button = st.form_submit_button(label='Abschicken (Submit)')
|
88 |
if submit_button:
|
89 |
if uploaded_file is not None and sample_query:
|
|
|
90 |
query_vector = embedding.encode(sample_query).tolist()
|
91 |
-
query_search = index.query(vector=query_vector, top_k=5, include_metadata=True)
|
92 |
|
93 |
-
matched_contents = [match["metadata"]["text"] for match in query_search["matches"]
|
94 |
|
95 |
# Rerank
|
96 |
rerank_model = "BAAI/bge-reranker-v2-m3"
|
|
|
87 |
submit_button = st.form_submit_button(label='Abschicken (Submit)')
|
88 |
if submit_button:
|
89 |
if uploaded_file is not None and sample_query:
|
90 |
+
# Encode the query and search in the Pinecone index
|
91 |
query_vector = embedding.encode(sample_query).tolist()
|
92 |
+
query_search = index.query(vector=query_vector, top_k=5, include_metadata=True,namespace='ns1')
|
93 |
|
94 |
+
matched_contents = [match["metadata"]["text"] for match in query_search["matches"]]
|
95 |
|
96 |
# Rerank
|
97 |
rerank_model = "BAAI/bge-reranker-v2-m3"
|