-
Notifications
You must be signed in to change notification settings - Fork 13.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Question Answering over Docs giving cryptic error upon query #2944
Comments
Based on the code you provided, it seems that you are correctly adding the 'source' key in the metadata of the documents. You have created metadatas with a list of dictionaries containing the 'source' key:
However, you don't seem to be using the metadatas while creating the FAISS store. If you need to store the metadata along with the documents, you need to modify the FAISS store or any other relevant data structure to include the metadata information.
The code you provided is only ingesting the data into a FAISS index and saving it to disk. The KeyError might be occurring later in the pipeline when you use this data along with the MapReduceDocumentsChain you provided earlier. Make sure that when you create Document objects, you include the metadata from metadatas in the process, and use these Document objects as input to the MapReduceDocumentsChain or any other part of the pipeline where the metadata is required. |
@cnhhoang850 slightly more generic fix for #2944, works for whatever the expected metadata keys are not just `source`
@cnhhoang850 slightly more generic fix for langchain-ai#2944, works for whatever the expected metadata keys are not just `source`
Hi, @ahmadsb86. I'm Dosu, and I'm helping the LangChain team manage their backlog. I wanted to let you know that we are marking this issue as stale. Based on my understanding, you encountered a KeyError for the 'source' key when running the Before we close this issue, we wanted to check if it is still relevant to the latest version of the LangChain repository. If it is, please let us know by commenting on the issue. Otherwise, feel free to close the issue yourself, or it will be automatically closed in 7 days. Thank you for your understanding and contribution to the LangChain project. Let us know if you have any further questions or concerns. |
After ingesting some markdown files using a slightly modified version of the question-answering over docs example, I ran the qa.py script as it was in the example
Only to get this cryptic error
Here is the code I used for ingesting
|
The text was updated successfully, but these errors were encountered: