Update app.py
Browse files
app.py
CHANGED
|
@@ -31,12 +31,14 @@ st.divider()
|
|
| 31 |
def search_index(query):
|
| 32 |
index = pinecone.Index("scotus")
|
| 33 |
vector = model.encode([query]).tolist()
|
| 34 |
-
|
| 35 |
-
|
| 36 |
|
| 37 |
|
| 38 |
search = st.text_input('Search', placeholder='First Amendment cannot protect libel')
|
| 39 |
-
|
|
|
|
|
|
|
| 40 |
|
| 41 |
|
| 42 |
|
|
|
|
| 31 |
def search_index(query):
|
| 32 |
index = pinecone.Index("scotus")
|
| 33 |
vector = model.encode([query]).tolist()
|
| 34 |
+
return index.query(vector=vector,top_k=10,include_values=False,include_metadata=True).tolist()
|
| 35 |
+
|
| 36 |
|
| 37 |
|
| 38 |
search = st.text_input('Search', placeholder='First Amendment cannot protect libel')
|
| 39 |
+
if search != "":
|
| 40 |
+
res = search_index(query=search)
|
| 41 |
+
st.write(res)
|
| 42 |
|
| 43 |
|
| 44 |
|