Spaces:
Running
Running
SnJForever
commited on
Commit
•
6981e3b
1
Parent(s):
be4b602
update
Browse files
app.py
CHANGED
@@ -217,7 +217,13 @@ def submit_message(type_select,user_token, prompt, prompt_template, temperature,
|
|
217 |
if len(answer) <= MAX_TALKING_HEAD_TEXT_LENGTH:
|
218 |
# html_video, temp_file = do_html_video_speak(output, translate_to)
|
219 |
html_audio, temp_aud_file = do_html_audio_speak_azure(answer)
|
220 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
221 |
else:
|
222 |
temp_file = LOOPING_TALKING_HEAD
|
223 |
html_video = create_html_video(temp_file, TALKING_HEAD_WIDTH)
|
@@ -241,7 +247,7 @@ def submit_message(type_select,user_token, prompt, prompt_template, temperature,
|
|
241 |
html_video = create_html_video(temp_file, TALKING_HEAD_WIDTH)
|
242 |
|
243 |
except Exception as e:
|
244 |
-
history.append(prompt_msg)
|
245 |
history.append({
|
246 |
"role": "system",
|
247 |
"content": f"Error: {e}"
|
|
|
217 |
if len(answer) <= MAX_TALKING_HEAD_TEXT_LENGTH:
|
218 |
# html_video, temp_file = do_html_video_speak(output, translate_to)
|
219 |
html_audio, temp_aud_file = do_html_audio_speak_azure(answer)
|
220 |
+
|
221 |
+
try:
|
222 |
+
html_video, temp_file = do_html_video_speak_sad_talker(temp_aud_file)
|
223 |
+
html_audio = None
|
224 |
+
except Exception as e:
|
225 |
+
temp_file = LOOPING_TALKING_HEAD
|
226 |
+
html_video = create_html_video(temp_file, TALKING_HEAD_WIDTH)
|
227 |
else:
|
228 |
temp_file = LOOPING_TALKING_HEAD
|
229 |
html_video = create_html_video(temp_file, TALKING_HEAD_WIDTH)
|
|
|
247 |
html_video = create_html_video(temp_file, TALKING_HEAD_WIDTH)
|
248 |
|
249 |
except Exception as e:
|
250 |
+
# history.append(prompt_msg)
|
251 |
history.append({
|
252 |
"role": "system",
|
253 |
"content": f"Error: {e}"
|