KvrParaskevi commited on
Commit
85426f6
1 Parent(s): 7ee74de

Update chatbot.py

Browse files
Files changed (1) hide show
  1. chatbot.py +5 -2
chatbot.py CHANGED
@@ -69,7 +69,7 @@ llm = load_pipeline()
69
 
70
  def demo_miny_memory():
71
  #prompt = ChatPromptTemplate.from_template(template)
72
- memory = ConversationBufferMemory(llm = llm, memory_key = "history")
73
  return memory
74
 
75
  @spaces.GPU
@@ -84,5 +84,8 @@ def demo_chain(input_text,history):
84
  memory=demo_miny_memory()
85
  )
86
 
87
- chat_reply = conversation.invoke(input=input_text, return_only_outputs=True)
 
 
 
88
  return chat_reply #['response'].split('AI:')[-1]
 
69
 
70
  def demo_miny_memory():
71
  #prompt = ChatPromptTemplate.from_template(template)
72
+ memory = ConversationSummaryBufferMemory(llm = llm, memory_key = "history")
73
  return memory
74
 
75
  @spaces.GPU
 
84
  memory=demo_miny_memory()
85
  )
86
 
87
+ chat_reply = conversation.invoke({
88
+ "input" : input_text,
89
+ "history" : history
90
+ }, return_only_outputs=True)
91
  return chat_reply #['response'].split('AI:')[-1]