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