Skip to content
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

class 'NoneType' error for RetrievalQA #1687

Open
huu3301 opened this issue Apr 12, 2024 · 2 comments
Open

class 'NoneType' error for RetrievalQA #1687

huu3301 opened this issue Apr 12, 2024 · 2 comments

Comments

@huu3301
Copy link

huu3301 commented Apr 12, 2024

Describe the bug
When I closed the button of "Return source Documents" on RetrievalQA component, the flow was successful but it raised error.

Browser and Version

  • Browser: chrome
  • Version: 123.0.6312.106
  • langflow version: the latest version of dev branch in github (probably v1.0.0a12 version)

To Reproduce
Steps to reproduce the behavior:

  1. Create components: TextLoader -> Recursive Character Text splitter -> OpenAI Embeddings -> FAISS
  2. Create components: Chat Input -> Prompt
  3. Create components: ChatOpenAI -> RetrievalQA -> Chat Output
  4. Close the button of "Return Source Documents" on RetrievalQA

Screenshots
When I opened the button of "Return source Documents", the flow was successful and I got the result.

2

But if I closed this button, it raised error:
Error building vertex Retrieval QA: Invalid data type: <class 'NoneType'>.

3

@huu3301
Copy link
Author

huu3301 commented Apr 19, 2024

I know where is the bug:
In RetrievalQA.py, if return_source_documents is false, the result.get("source_documents") is None, this causes a bug in self.to_records function.
image

@anovazzi1
Copy link
Contributor

Hello,
Sorry for the delay. Did you try using the new version? Does the error still persist?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants