Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -132,6 +132,7 @@ def retrieve_gradio(knowledge_base: str, query: str, topk: int):
|
|
132 |
|
133 |
doc_reps_cat = torch.stack([torch.Tensor(i) for i in doc_reps], dim=0)
|
134 |
|
|
|
135 |
similarities = torch.matmul(query_rep, doc_reps_cat.T)
|
136 |
|
137 |
topk_values, topk_doc_ids = torch.topk(similarities, k=topk)
|
|
|
132 |
|
133 |
doc_reps_cat = torch.stack([torch.Tensor(i) for i in doc_reps], dim=0)
|
134 |
|
135 |
+
print(f"query_rep_shape: {query_rep.shape}, doc_reps_cat_shape: {doc_reps_cat.shape}")
|
136 |
similarities = torch.matmul(query_rep, doc_reps_cat.T)
|
137 |
|
138 |
topk_values, topk_doc_ids = torch.topk(similarities, k=topk)
|