Skip to content

Commit

Permalink
fixed pinecone type errors
Browse files Browse the repository at this point in the history
  • Loading branch information
AmoghTantradi committed Jan 16, 2025
1 parent c3e0f0c commit 1782281
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lotus/vector_store/pinecone_vs.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def __init__(self, api_key: str, embedding_model: Callable[[pd.Series | list], N
"""Initialize Pinecone client with API key and environment"""
super().__init__(embedding_model)
self.pinecone = Pinecone(api_key=api_key)
self.index = None
self.pc_index = None
self.max_batch_size = max_batch_size


Expand Down Expand Up @@ -107,7 +107,7 @@ def __call__(

for query_vector in query_vectors:
# Query Pinecone
results = self.index.query(
results = self.pc_index.query(
vector=query_vector.tolist(),
top_k=K,
include_metadata=True,
Expand All @@ -131,8 +131,8 @@ def __call__(
all_indices.append(indices)

return RMOutput(
distances=np.array(all_distances, dtype=np.float32),
indices=np.array(all_indices, dtype=np.int64)
distances=np.array(all_distances, dtype=np.float32).tolist(),
indices=np.array(all_indices, dtype=np.int64).tolist()
)

def get_vectors_from_index(self, collection_name: str, ids: list[int]) -> NDArray[np.float64]:
Expand Down

0 comments on commit 1782281

Please sign in to comment.