Tonic commited on
Commit
3948c4b
β€’
1 Parent(s): 2606229

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -7
app.py CHANGED
@@ -99,13 +99,12 @@ def predict(_chatbot, task_history, user_input):
99
  audio_clip.export(filename, format=format)
100
  _chatbot[-1] = (_parse_text(query), chat_response)
101
  _chatbot.append((None, (str(filename),)))
102
- else:
103
- _chatbot[-1] = (_parse_text(query), response)
104
- full_response = _parse_text(response)
105
- task_history[-1] = (query, full_response)
106
- print("Qwen-Audio-Chat: " + _parse_text(full_response))
107
- print("Predict - End: task_history =", task_history)
108
- return _chatbot
109
 
110
  def regenerate(_chatbot, task_history):
111
  print("Regenerate - Start: task_history =", task_history)
 
99
  audio_clip.export(filename, format=format)
100
  _chatbot[-1] = (_parse_text(query), chat_response)
101
  _chatbot.append((None, (str(filename),)))
102
+ if not _chatbot:
103
+ _chatbot = [("", "")]
104
+
105
+ print("Predict - End: task_history =", task_history)
106
+ return _chatbot[-1][1], _chatbot
107
+
 
108
 
109
  def regenerate(_chatbot, task_history):
110
  print("Regenerate - Start: task_history =", task_history)