Spaces:
Runtime error
Runtime error
captain-awesome
commited on
Commit
•
825380b
1
Parent(s):
31a7cce
Update app.py
Browse files
app.py
CHANGED
@@ -223,12 +223,13 @@ def create_chain(llm, prompt, CONDENSE_QUESTION_PROMPT, db):
|
|
223 |
Returns:
|
224 |
ConversationalRetrievalChain: The initialized conversational chain.
|
225 |
"""
|
226 |
-
memory = ConversationTokenBufferMemory(llm=llm, memory_key="chat_history", return_messages=True, input_key='question'
|
227 |
chain = ConversationalRetrievalChain.from_llm(
|
228 |
llm=llm,
|
229 |
chain_type="stuff",
|
230 |
retriever=db.as_retriever(search_kwargs={"k": 3}),
|
231 |
return_source_documents=True,
|
|
|
232 |
combine_docs_chain_kwargs={"prompt": prompt},
|
233 |
condense_question_prompt=CONDENSE_QUESTION_PROMPT,
|
234 |
memory=memory,
|
|
|
223 |
Returns:
|
224 |
ConversationalRetrievalChain: The initialized conversational chain.
|
225 |
"""
|
226 |
+
memory = ConversationTokenBufferMemory(llm=llm, memory_key="chat_history", return_messages=True, input_key='question')
|
227 |
chain = ConversationalRetrievalChain.from_llm(
|
228 |
llm=llm,
|
229 |
chain_type="stuff",
|
230 |
retriever=db.as_retriever(search_kwargs={"k": 3}),
|
231 |
return_source_documents=True,
|
232 |
+
max_tokens_limit=512,
|
233 |
combine_docs_chain_kwargs={"prompt": prompt},
|
234 |
condense_question_prompt=CONDENSE_QUESTION_PROMPT,
|
235 |
memory=memory,
|