Spaces:
Running
Running
littlebird13
commited on
Commit
•
0d90efe
1
Parent(s):
2d29182
Update app.py
Browse files
app.py
CHANGED
@@ -8,12 +8,15 @@ YOUR_API_TOKEN = os.getenv('YOUR_API_TOKEN')
|
|
8 |
dashscope.api_key = YOUR_API_TOKEN
|
9 |
|
10 |
def add_text(chatbot, task_history, input):
|
11 |
-
|
|
|
12 |
if len (input.files) > 0:
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
|
|
|
|
17 |
chatbot.append([{
|
18 |
"text": input.text,
|
19 |
"files": input.files,
|
|
|
8 |
dashscope.api_key = YOUR_API_TOKEN
|
9 |
|
10 |
def add_text(chatbot, task_history, input):
|
11 |
+
text_content = input.text
|
12 |
+
content = []
|
13 |
if len (input.files) > 0:
|
14 |
+
for i in input.files:
|
15 |
+
content.append({'audio': i.path})
|
16 |
+
if text_content:
|
17 |
+
content.append({'text': text_content})
|
18 |
+
task_history.append({"role": "user", "content": content})
|
19 |
+
|
20 |
chatbot.append([{
|
21 |
"text": input.text,
|
22 |
"files": input.files,
|