Find answers from the community

Updated 6 months ago

SubQuestionQueryEngine.from_defaults

At a glance

A community member is a beginner in llama_index and is encountering an error when using SubQuestionQueryEngine.from_defaults(query_engine_tools=query_engine_tools) with verbose=False. The error message is "free variable 'colors' referenced before assignment in enclosing scope". Another community member suggests using verbose=True as a temporary workaround, and mentions that a fix has been merged and will be available in the next PyPI release or can be installed from source. The community member later confirms that the fix works after implementing the modification.

Useful resources
Hi, I am a beginner in llama_index. When I use SubQuestionQueryEngine.from_defaults(query_engine_tools=query_engine_tools) and add verbose=False to avoid output I get the error message 'free variable 'colors' referenced before assignment in enclosing scope':
How can I avoid this. Thanks
D
L
7 comments
can someone help me?
this is a bug, use verbose=True for now, I'll have to merge a fix shortly
You can use your doc example:
https://gpt-index.readthedocs.io/en/latest/examples/usecases/10k_sub_question.html
You can change in paragraph "Build query engines":
s_engine = SubQuestionQueryEngine.from_defaults(query_engine_tools=query_engine_tools)
to
SubQuestionQueryEngine.from_defaults(query_engine_tools=query_engine_tools, verbose = False)
Just merged a fix for this earlier today. It'll be in the next pypi release, or you can install from source to get it now
I implemented the modification into my installation - it works fine.
Thanks Logan
Add a reply
Sign up and join the conversation on Discord