Spaces:
Sleeping
Sleeping
change?
Browse files
app.py
CHANGED
|
@@ -128,11 +128,14 @@ def generate_response(audio_path, message, chat_history=None):
|
|
| 128 |
conversation.append({"role": "assistant", "content": bot_msg})
|
| 129 |
|
| 130 |
if audio_path:
|
| 131 |
-
#
|
| 132 |
-
#
|
| 133 |
conversation.append({
|
| 134 |
"role": "user",
|
| 135 |
-
"content":
|
|
|
|
|
|
|
|
|
|
| 136 |
})
|
| 137 |
|
| 138 |
audio_data = process_audio_file(audio_path)
|
|
|
|
| 128 |
conversation.append({"role": "assistant", "content": bot_msg})
|
| 129 |
|
| 130 |
if audio_path:
|
| 131 |
+
# Match the format that was working in the original code
|
| 132 |
+
# Create a placeholder audio URL to ensure the <|AUDIO|> token is generated
|
| 133 |
conversation.append({
|
| 134 |
"role": "user",
|
| 135 |
+
"content": [
|
| 136 |
+
{"type": "audio", "audio_url": "placeholder_audio_url"},
|
| 137 |
+
{"type": "text", "text": message}
|
| 138 |
+
]
|
| 139 |
})
|
| 140 |
|
| 141 |
audio_data = process_audio_file(audio_path)
|