sooolee commited on
Commit
85ebbbd
1 Parent(s): b1cf4ab

change memory to window

Browse files
Files changed (1) hide show
  1. chain.py +2 -2
chain.py CHANGED
@@ -42,8 +42,8 @@ def get_chain():
42
  """
43
 
44
  prompt = PromptTemplate(input_variables=["chat_history", "query", "context"], template=template)
45
- memory = ConversationBufferMemory(memory_key="chat_history", input_key="query")
46
- chat = ChatOpenAI(temperature=0, streaming=True, max_token=400)
47
 
48
  chain = load_qa_chain(llm=chat, chain_type="stuff", memory=memory, prompt=prompt)
49
 
 
42
  """
43
 
44
  prompt = PromptTemplate(input_variables=["chat_history", "query", "context"], template=template)
45
+ memory = ConversationBufferWindowMemory(memory_key="chat_history", input_key="query", k=6)
46
+ chat = ChatOpenAI(temperature=0, streaming=True)
47
 
48
  chain = load_qa_chain(llm=chat, chain_type="stuff", memory=memory, prompt=prompt)
49