Jonas Wiesli commited on
Commit
a803285
1 Parent(s): 07fe324

add debug info

Browse files
Files changed (1) hide show
  1. app.py +14 -0
app.py CHANGED
@@ -84,6 +84,7 @@ with gr.Blocks() as iface:
84
  return completion.choices[0].message.content
85
 
86
  def updateQuestions(prevText):
 
87
  remainingQuestions = prevText.split(": ")[1]
88
  remainingQuestions -= 1
89
  return "Remaining Questions: " + remainingQuestions
@@ -94,17 +95,30 @@ with gr.Blocks() as iface:
94
  ).then(
95
  updateQuestions, questionCounter, questionCounter
96
  )
 
97
  msg[1].submit(user, [msg[1], chatbot[1]], [msg[1], chatbot[1]], queue=False).then(
98
  bot1, chatbot[1], chatbot[1]
 
 
99
  )
 
100
  msg[2].submit(user, [msg[2], chatbot[2]], [msg[2], chatbot[2]], queue=False).then(
101
  bot2, chatbot[2], chatbot[2]
 
 
102
  )
 
103
  msg[3].submit(user, [msg[3], chatbot[3]], [msg[3], chatbot[3]], queue=False).then(
104
  bot3, chatbot[3], chatbot[3]
 
 
105
  )
 
106
  msg[4].submit(user, [msg[4], chatbot[4]], [msg[4], chatbot[4]], queue=False).then(
107
  bot4, chatbot[4], chatbot[4]
 
 
108
  )
109
 
 
110
  iface.launch()
 
84
  return completion.choices[0].message.content
85
 
86
  def updateQuestions(prevText):
87
+ print(prevText)
88
  remainingQuestions = prevText.split(": ")[1]
89
  remainingQuestions -= 1
90
  return "Remaining Questions: " + remainingQuestions
 
95
  ).then(
96
  updateQuestions, questionCounter, questionCounter
97
  )
98
+
99
  msg[1].submit(user, [msg[1], chatbot[1]], [msg[1], chatbot[1]], queue=False).then(
100
  bot1, chatbot[1], chatbot[1]
101
+ ).then(
102
+ updateQuestions, questionCounter, questionCounter
103
  )
104
+
105
  msg[2].submit(user, [msg[2], chatbot[2]], [msg[2], chatbot[2]], queue=False).then(
106
  bot2, chatbot[2], chatbot[2]
107
+ ).then(
108
+ updateQuestions, questionCounter, questionCounter
109
  )
110
+
111
  msg[3].submit(user, [msg[3], chatbot[3]], [msg[3], chatbot[3]], queue=False).then(
112
  bot3, chatbot[3], chatbot[3]
113
+ ).then(
114
+ updateQuestions, questionCounter, questionCounter
115
  )
116
+
117
  msg[4].submit(user, [msg[4], chatbot[4]], [msg[4], chatbot[4]], queue=False).then(
118
  bot4, chatbot[4], chatbot[4]
119
+ ).then(
120
+ updateQuestions, questionCounter, questionCounter
121
  )
122
 
123
+
124
  iface.launch()