LangChain嵌入张量错误制作嵌入问题

huangapple go评论59阅读模式
英文:

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?

huangapple
  • 本文由 发表于 2023年6月12日 08:54:12
  • 转载请务必保留本文链接:https://go.coder-hub.com/76453094.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定