littlebird13 commited on
Commit
31dab52
·
verified ·
1 Parent(s): e77241a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -10,7 +10,8 @@ dashscope.api_key = YOUR_API_TOKEN
10
  def add_text(chatbot, task_history, input):
11
  """Add text to the chat history."""
12
  task_history.append({"role": "user", "content": [{"text": input.text}]})
13
- task_history.append({"role": "user", "content": [{"audio": input.files[0].path}]})
 
14
  chatbot.append([{
15
  "text": input.text,
16
  "files": input.files,
 
10
  def add_text(chatbot, task_history, input):
11
  """Add text to the chat history."""
12
  task_history.append({"role": "user", "content": [{"text": input.text}]})
13
+ if len (input.files) > 0:
14
+ task_history.append({"role": "user", "content": [{"audio": input.files[0].path}]})
15
  chatbot.append([{
16
  "text": input.text,
17
  "files": input.files,