teaevo commited on
Commit
9b6d8c5
1 Parent(s): 35c1c0b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -66,7 +66,7 @@ sql_model = BartForConditionalGeneration.from_pretrained(sql_model_name)
66
  #sql_response = None
67
  conversation_history = []
68
 
69
- def predict(input, conversation_history): #history=[]):
70
 
71
  #global sql_response
72
  # Check if the user input is a question
@@ -109,9 +109,9 @@ def chatbot_interface(user_input):
109
  conversation_history.append(user_input)
110
 
111
  dialog_prompt = "User: " + " ".join(conversation_history) + "\nBot:"
112
- response = predict(dialog_prompt, conversation_history)
113
  conversation_history.append(response)
114
- return "Bot (DialoGPT): " + response
115
 
116
  def sqlquery(input):
117
 
@@ -124,8 +124,8 @@ def sqlquery(input):
124
 
125
  chat_interface = gr.Interface(
126
  fn=chatbot_interface,
127
- inputs=["text"],
128
- outputs=["chatbot"],
129
  live=True,
130
 
131
  )
 
66
  #sql_response = None
67
  conversation_history = []
68
 
69
+ def predict(input): #history=[]):
70
 
71
  #global sql_response
72
  # Check if the user input is a question
 
109
  conversation_history.append(user_input)
110
 
111
  dialog_prompt = "User: " + " ".join(conversation_history) + "\nBot:"
112
+ response = predict(dialog_prompt)
113
  conversation_history.append(response)
114
+ return response
115
 
116
  def sqlquery(input):
117
 
 
124
 
125
  chat_interface = gr.Interface(
126
  fn=chatbot_interface,
127
+ inputs=gr.Textbox(prompt="You:"),
128
+ outputs=gr.Textbox(),
129
  live=True,
130
 
131
  )