brunhild217 commited on
Commit
d8ad4e5
·
1 Parent(s): fa1ff63

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -5
app.py CHANGED
@@ -5,10 +5,6 @@ from functools import partial
5
  from ai_classroom_suite.UIBaseComponents import *
6
 
7
  ### Chatbot Functions ###
8
- def add_user_message(user_message, chat_tutor):
9
- chat_tutor.add_user_message(user_message)
10
- return chat_tutor.conversation_memory, chat_tutor
11
-
12
  def get_tutor_reply(chat_tutor):
13
  chat_tutor.get_tutor_reply()
14
  return gr.update(value="", interactive=True), chat_tutor.conversation_memory, chat_tutor
@@ -52,7 +48,7 @@ with gr.Blocks() as demo:
52
  # First add user's message to the conversation history
53
  # Then get reply from the tutor and add that to the conversation history
54
  user_chat_submit.click(
55
- fn = add_user_message, inputs = [user_chat_input, study_tutor], outputs = [chatbot, study_tutor], queue=False
56
  ).then(
57
  fn = get_tutor_reply, inputs = [study_tutor], outputs = [user_chat_input, chatbot, study_tutor], queue=True
58
  )
 
5
  from ai_classroom_suite.UIBaseComponents import *
6
 
7
  ### Chatbot Functions ###
 
 
 
 
8
  def get_tutor_reply(chat_tutor):
9
  chat_tutor.get_tutor_reply()
10
  return gr.update(value="", interactive=True), chat_tutor.conversation_memory, chat_tutor
 
48
  # First add user's message to the conversation history
49
  # Then get reply from the tutor and add that to the conversation history
50
  user_chat_submit.click(
51
+ fn = add_user_message, inputs = [user_chat_input, study_tutor], outputs = [user_chat_input, chatbot, study_tutor], queue=False
52
  ).then(
53
  fn = get_tutor_reply, inputs = [study_tutor], outputs = [user_chat_input, chatbot, study_tutor], queue=True
54
  )