Spaces:
Running
on
Zero
Running
on
Zero
Commit
·
2081cae
1
Parent(s):
4c922d8
debug
Browse files- conversation_public.py +3 -5
conversation_public.py
CHANGED
@@ -212,16 +212,14 @@ class Conversation:
|
|
212 |
ret_msg += audio_str
|
213 |
else:
|
214 |
ret_msg += msg.replace('<image>', '').replace(tts_format, '').strip()
|
215 |
-
ret.append(
|
216 |
else:
|
217 |
-
ret.append(
|
218 |
else:
|
219 |
if type(msg) is tuple:
|
220 |
audio_b64_str = base64.b64encode(open(msg[1], "rb").read()).decode("utf-8")
|
221 |
msg = f'<audio src="data:audio/wav;base64,{audio_b64_str}" controls autoplay></audio>'
|
222 |
-
|
223 |
-
ret[-1][-1] = ()
|
224 |
-
ret[-1][-1] += (msg, )
|
225 |
return ret
|
226 |
|
227 |
def copy(self):
|
|
|
212 |
ret_msg += audio_str
|
213 |
else:
|
214 |
ret_msg += msg.replace('<image>', '').replace(tts_format, '').strip()
|
215 |
+
ret.append({"role": "user", "content": ret_msg})
|
216 |
else:
|
217 |
+
ret.append({"role": "user", "content": msg})
|
218 |
else:
|
219 |
if type(msg) is tuple:
|
220 |
audio_b64_str = base64.b64encode(open(msg[1], "rb").read()).decode("utf-8")
|
221 |
msg = f'<audio src="data:audio/wav;base64,{audio_b64_str}" controls autoplay></audio>'
|
222 |
+
ret.append({"role": "assistant", "content": msg})
|
|
|
|
|
223 |
return ret
|
224 |
|
225 |
def copy(self):
|