lifewjola commited on
Commit
9379371
·
1 Parent(s): d2f3602

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -2
app.py CHANGED
@@ -13,12 +13,20 @@ tqa = pipeline(task="table-question-answering", model=model, tokenizer=tokenizer
13
  table = pd.read_csv('CSLECTURERS.csv')
14
  table = table.astype('str')
15
 
 
 
16
 
17
  def anjibot(message, history):
 
 
18
  answer = tqa(table=table, query=message)["answer"]
 
19
  return "AnjiBot: " + answer
20
 
21
-
22
- chatbot = gr.ChatInterface(anjibot, title='AnjiBot', description="Anji is unavailable? That girl! Ask me, I may know!")
 
 
 
23
 
24
  chatbot.launch()
 
13
  table = pd.read_csv('CSLECTURERS.csv')
14
  table = table.astype('str')
15
 
16
+ messages = []
17
+ responses = []
18
 
19
  def anjibot(message, history):
20
+ messages.append(message)
21
+ conversation = {"text": message, "past_user_input": messages, "generated_responses": responses}
22
  answer = tqa(table=table, query=message)["answer"]
23
+ responses.append(answer)
24
  return "AnjiBot: " + answer
25
 
26
+ chatbot = gr.ChatInterface(anjibot, title='AnjiBot', description="Anji is unavailable? That girl! Ask me, I may know!",
27
+ live=True,
28
+ layout="vertical"
29
+ width=800,
30
+ height=600)
31
 
32
  chatbot.launch()