[Bug] Missing documentation on creation of ndarray for serialization
Is this a new bug?
- [X] I believe this is a new bug
- [X] I have searched the existing issues, and I could not find an existing issue for this bug
Current Behavior
The below line of code throws an error Type Error expected ndarray for serialization.
embeddings = model.encode(sentences) embeddings.shape
Expected Behavior
We simply need to convert the model encoding to a list, which will resolve the above array.
Steps To Reproduce
Modify embeddings = model.encode(sentences) to embeddings = model.encode(sentences).tolist()
Relevant log output
No response
Environment
- **OS**:
- **Language version**:
- **Pinecone client version**:
Additional Context
Here's the link to the page which references the above issue: https://www.pinecone.io/learn/series/nlp/dense-vector-embeddings-nlp/
I'm happy to work on this issue and update the documentation as well, feel free to assign it to me
Cc @jamescalam for review, Thanks
hey @SID262000 — I don't know what exactly is causing the issue here. Performing model.encode(sentences) (assuming sentences is a normal python list) should work — and it would output a numpy array, which allows us to do embeddings.shape as shown. Maybe there is something wrong with the sentences data type here?
Hi @jamescalam,
sentences in the above context is a list of strings