Cyantist8208 commited on
Commit
4416e19
·
1 Parent(s): 9d99ca9
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -120,7 +120,7 @@ def answer(system: str, context: str, question: str, user_id="demo", history="No
120
  context_list = [context]
121
  # 1. Retrieve top-k similar passages
122
  if history == "Some":
123
- q_vec = embed(question).cpu()
124
  store = kb[user_id]
125
  sims = torch.matmul(store["vecs"], q_vec) # [N]
126
  k = min(4, sims.numel())
 
120
  context_list = [context]
121
  # 1. Retrieve top-k similar passages
122
  if history == "Some":
123
+ q_vec = embed(question).T.cpu()
124
  store = kb[user_id]
125
  sims = torch.matmul(store["vecs"], q_vec) # [N]
126
  k = min(4, sims.numel())