英文:
LangChain embedding tensor error making embedding question
问题
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?
英文:
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?
答案1
得分: 1
我的假设是错误是由于底层数据缺少某些信息或预期的结构引起的。我认为嵌入张量可能是空的。
您可以使用 vector_store.ds.summary() 来检查嵌入张量中是否有数据吗?
英文:
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?
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论