EC2 Default User commited on
Commit
58f0fe7
1 Parent(s): 458be33
Files changed (1) hide show
  1. app.py +1 -7
app.py CHANGED
@@ -135,12 +135,6 @@ def predict(input, history=[]):
135
  print("all historical responses: "+str(responses))
136
  return responses, audio_file, history
137
 
138
- def predict_text_only(input, history=[]):
139
- history.append(input)
140
- response = conversation.predict(input=input)
141
- audio_file = "/tmp/fake.mp3"
142
- return response, audio_file, history
143
-
144
  def transcribe_func(audio):
145
  audio_file = open(audio, "rb")
146
  file_name = audio_file.name
@@ -227,7 +221,7 @@ with gr.Blocks(css="#chatbot{height:350px} .overflow-y-auto{height:500px}") as d
227
 
228
  #audio_html = gr.HTML()
229
 
230
- txt.submit(predict_text_only, [txt, state], [chatbot, audio_output, state])
231
  audio_input.change(process_audio, [audio_input, state], [chatbot, audio_output, state])
232
 
233
  demo.launch(debug=True)
 
135
  print("all historical responses: "+str(responses))
136
  return responses, audio_file, history
137
 
 
 
 
 
 
 
138
  def transcribe_func(audio):
139
  audio_file = open(audio, "rb")
140
  file_name = audio_file.name
 
221
 
222
  #audio_html = gr.HTML()
223
 
224
+ txt.submit(predict, [txt, state], [chatbot, audio_output, state])
225
  audio_input.change(process_audio, [audio_input, state], [chatbot, audio_output, state])
226
 
227
  demo.launch(debug=True)