Hi! I am receiving the following error in Python when attempting to send data to Pinecone’s index:
Unable to prepare type ndarray for serialization
The code is as follows:
device = ‘cuda’ if torch.cuda.is_available() else ‘cpu’
model = SentenceTransformer(“all-MiniLM-L6-v2”, device=device)
vector = model.encode(paragraph_of_text)
_id = str(id)
metadata = {‘text’: paragraph_of_text}
vectors = [((_id, vector, metadata))]
index = pinecone.Index(“my_index”)
index.upsert(vectors=vectors) <== HERE IS WHERE ERROR OCCURS
appears to be associated with a call stack to:
_create_pinecone_vector: 99.
Thanks for any ideas on how to resolve this!