Understanding collapse_prompt
in the map_reduce load_qa_chain
in ConversationalRetrievalChain
#6292
Unanswered
exfalsoquodlibet
asked this question in
Q&A
Replies: 1 comment
-
@exfalsoquodlibet I'm wondering this too. Did you figure it out? I'm trying to create a ConversationalRetrievalChain that can stream it's final answer back, but there's not a lot of information on the optional arguments that enable you to use a different LLM for the collapse stage. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
In the context of a ConversationalRetrievalChain, when using
chain_type = "map_reduce"
,I am unsure how
collapse_prompt
should be set up.I understand that:
collapse_prompt
is the prompt of the (optional)collapse_document_chain
within aMapReduceDocumentsChain
, which is the type ofcombined_docs_chain
/load_qa_chain
if chain_type is set to "map_reduce", and thatcollapse_document_chain
is defined as "Chain to use to collapse intermediary results if needed" see source code.collapse_prompt
is an optional argument, and that if not provided, nocollapse_chain
gets executed (source code):collapse_prompt
is provided, thencollapse_chain
is executed and is a StuffDocumentChain (source code)Looking at the source code for
StaffDocumentsChain
, it looks like the default prompt is just to retrieve the whole content of the provided text:Grateful for any clarifications on how the
collapse_prompt
should be crafted? Tnx!Beta Was this translation helpful? Give feedback.
All reactions