mclemcrew commited on
Commit
ed7ce23
·
1 Parent(s): 288729f
Files changed (1) hide show
  1. app.py +6 -3
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
- # For files, we don't include an audio_url in the conversation
132
- # Instead we just process the audio data directly
133
  conversation.append({
134
  "role": "user",
135
- "content": message
 
 
 
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)