Update app.py
Browse files
app.py
CHANGED
|
@@ -9,7 +9,7 @@ import torch
|
|
| 9 |
|
| 10 |
index = faiss.read_index("index.faiss")
|
| 11 |
|
| 12 |
-
with open("
|
| 13 |
texts = pickle.load(f)
|
| 14 |
|
| 15 |
|
|
@@ -55,7 +55,7 @@ def retrieve(query, k=3):
|
|
| 55 |
|
| 56 |
scores, ids = index.search(q, k)
|
| 57 |
|
| 58 |
-
return [texts[i] for i in ids[0]]
|
| 59 |
|
| 60 |
|
| 61 |
with gr.Blocks() as demo:
|
|
|
|
| 9 |
|
| 10 |
index = faiss.read_index("index.faiss")
|
| 11 |
|
| 12 |
+
with open("texts_long.pkl", "rb") as f:
|
| 13 |
texts = pickle.load(f)
|
| 14 |
|
| 15 |
|
|
|
|
| 55 |
|
| 56 |
scores, ids = index.search(q, k)
|
| 57 |
|
| 58 |
+
return [str(i) +": " + texts[i] + "\n" for i in ids[0]]
|
| 59 |
|
| 60 |
|
| 61 |
with gr.Blocks() as demo:
|