Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -78,14 +78,21 @@ class DocumentRetrievalAndGeneration:
|
|
78 |
distances, indices = self.gpu_index.search(np.array([query_embedding]), k=5)
|
79 |
|
80 |
content = ""
|
81 |
-
for idx in indices[0]:
|
82 |
content += "-" * 50 + "\n"
|
83 |
content += self.all_splits[idx].page_content + "\n"
|
84 |
-
distance=distances[0][i]
|
85 |
print("CHUNK", idx)
|
86 |
-
print("Distance
|
87 |
print(self.all_splits[idx].page_content)
|
88 |
print("############################")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
89 |
prompt = f"""<s>
|
90 |
You are a knowledgeable assistant with access to a comprehensive database.
|
91 |
I need you to answer my question and provide related information in a specific format.
|
|
|
78 |
distances, indices = self.gpu_index.search(np.array([query_embedding]), k=5)
|
79 |
|
80 |
content = ""
|
81 |
+
for idx, distance in zip(indices[0], distances[0]):
|
82 |
content += "-" * 50 + "\n"
|
83 |
content += self.all_splits[idx].page_content + "\n"
|
|
|
84 |
print("CHUNK", idx)
|
85 |
+
print("Distance:", distance)
|
86 |
print(self.all_splits[idx].page_content)
|
87 |
print("############################")
|
88 |
+
# for idx in indices[0]:
|
89 |
+
# content += "-" * 50 + "\n"
|
90 |
+
# content += self.all_splits[idx].page_content + "\n"
|
91 |
+
# distance=distances[0][i]
|
92 |
+
# print("CHUNK", idx)
|
93 |
+
# print("Distance :",distance)
|
94 |
+
# print(self.all_splits[idx].page_content)
|
95 |
+
# print("############################")
|
96 |
prompt = f"""<s>
|
97 |
You are a knowledgeable assistant with access to a comprehensive database.
|
98 |
I need you to answer my question and provide related information in a specific format.
|