0

I have used DeepLake and LangChain to make embeddings. I am looking to ask a question based on the embeddings. A simple one like:

Are their any randomness errors that can happen in solidity? 

To do this, I'm working with the following python code:

def ask_qa(qa: ConversationalRetrievalChain, question: str, chat_history: list = []):
    result = qa({"question": question, "chat_history": chat_history})

However, I'm getting this error:

deeplake.util.exceptions.DynamicTensorNumpyError: Tensor 'embedding' with index = Index([slice(None, None, None)]) has dynamic 'shape' and cannot be converted into a `np.ndarray`. Try setting the parameter `aslist=True`

How would I go about triaging this?

Patrick Collins
  • 5,621
  • 3
  • 26
  • 64
  • 1
    For those who have found this issue, I ended up re-creating the embeddings in deeplake and the issue is now gone. Maybe something with my data? – Patrick Collins Jun 12 '23 at 01:22

1 Answers1

1

My hypothesis is that the error is caused by the underlying data not having certain information or expected structure. I think the embedding tensor might be empty.

Can you check using vector_store.ds.summary() whether the embedding tensor has data in it?

istranic
  • 11
  • 2
  • Thanks! I ended up re-creating the deeplake vectorDB and the issue went away. There was probably an error with how it was created. – Patrick Collins Jun 12 '23 at 15:14