Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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(
|
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()
|