shrut123 commited on
Commit
febccb7
1 Parent(s): dd92eea

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -77,7 +77,7 @@ if pc:
77
  dense_vector = encode_query(model, query_text)
78
  input_ids = tokenizer(query_text, return_tensors='pt')
79
  with torch.no_grad():
80
- sparse_vector = sparse_model(d_kwargs=input_ids.to(device))['d_rep'].squeeze()
81
 
82
  # Prepare sparse vector format for Pinecone
83
  indices = sparse_vector.nonzero().squeeze().cpu().tolist()
 
77
  dense_vector = encode_query(model, query_text)
78
  input_ids = tokenizer(query_text, return_tensors='pt')
79
  with torch.no_grad():
80
+ sparse_vector = sparse_model(d_kwargs=input_ids.to('cpu'))['d_rep'].squeeze()
81
 
82
  # Prepare sparse vector format for Pinecone
83
  indices = sparse_vector.nonzero().squeeze().cpu().tolist()