gufett0 commited on
Commit
0a7d821
·
1 Parent(s): 281fce1

added memory

Browse files
Files changed (2) hide show
  1. app.py +4 -1
  2. backend.py +1 -1
app.py CHANGED
@@ -12,8 +12,11 @@ DESCRIPTION = """\
12
 
13
  chat_interface =gr.ChatInterface(
14
  fn=handle_query,
15
- chatbot=gr.Chatbot(height=400),
16
  textbox=gr.Textbox(placeholder="Chiedimi qualasiasi cosa relativa agli Osservatori", container=False, scale=7),
 
 
 
17
  )
18
 
19
 
 
12
 
13
  chat_interface =gr.ChatInterface(
14
  fn=handle_query,
15
+ chatbot=gr.Chatbot(height=650),
16
  textbox=gr.Textbox(placeholder="Chiedimi qualasiasi cosa relativa agli Osservatori", container=False, scale=7),
17
+ examples=[
18
+ ["Ciao, in cosa puoi aiutarmi?"],
19
+ ["Dimmi i risultati e le modalità di conduzione del censimento per favore"]]
20
  )
21
 
22
 
backend.py CHANGED
@@ -66,7 +66,7 @@ def handle_query(query_str: str,
66
 
67
  try:
68
 
69
- memory = ChatMemoryBuffer.from_defaults(token_limit=3900)
70
 
71
  conversation: List[ChatMessage] = []
72
  for user, assistant in chat_history:
 
66
 
67
  try:
68
 
69
+ memory = ChatMemoryBuffer.from_defaults(token_limit=None)
70
 
71
  conversation: List[ChatMessage] = []
72
  for user, assistant in chat_history: