Spaces:
Sleeping
Sleeping
Commit
·
2a82d23
1
Parent(s):
62e4476
Fixed talking head functionality
Browse files
app.py
CHANGED
@@ -415,7 +415,6 @@ class ChatWrapper:
|
|
415 |
if talking_head:
|
416 |
if len(output) <= MAX_TALKING_HEAD_TEXT_LENGTH:
|
417 |
html_video, temp_file = do_html_video_speak(output, translate_to)
|
418 |
-
html_video = create_html_video(temp_file, TALKING_HEAD_WIDTH)
|
419 |
else:
|
420 |
temp_file = LOOPING_TALKING_HEAD
|
421 |
html_video = create_html_video(temp_file, TALKING_HEAD_WIDTH)
|
@@ -490,7 +489,7 @@ def do_html_audio_speak(words_to_speak, polly_language):
|
|
490 |
|
491 |
def create_html_video(file_name, width):
|
492 |
temp_file_url = "/file=" + tmp_file.value['name']
|
493 |
-
html_video = f'<video width={width} height={width} autoplay muted loop><source src={temp_file_url} type="video/mp4" poster="
|
494 |
return html_video
|
495 |
|
496 |
|
@@ -523,7 +522,7 @@ def do_html_video_speak(words_to_speak, azure_language):
|
|
523 |
f.write(response_stream.read())
|
524 |
temp_file = gr.File("videos/tempfile.mp4")
|
525 |
temp_file_url = "/file=" + temp_file.value['name']
|
526 |
-
html_video = f'<video width={TALKING_HEAD_WIDTH} height={TALKING_HEAD_WIDTH} autoplay><source src={temp_file_url} type="video/mp4" poster="
|
527 |
else:
|
528 |
print('video url unknown')
|
529 |
return html_video, "videos/tempfile.mp4"
|
|
|
415 |
if talking_head:
|
416 |
if len(output) <= MAX_TALKING_HEAD_TEXT_LENGTH:
|
417 |
html_video, temp_file = do_html_video_speak(output, translate_to)
|
|
|
418 |
else:
|
419 |
temp_file = LOOPING_TALKING_HEAD
|
420 |
html_video = create_html_video(temp_file, TALKING_HEAD_WIDTH)
|
|
|
489 |
|
490 |
def create_html_video(file_name, width):
|
491 |
temp_file_url = "/file=" + tmp_file.value['name']
|
492 |
+
html_video = f'<video width={width} height={width} autoplay muted loop><source src={temp_file_url} type="video/mp4" poster="Marc.png"></video>'
|
493 |
return html_video
|
494 |
|
495 |
|
|
|
522 |
f.write(response_stream.read())
|
523 |
temp_file = gr.File("videos/tempfile.mp4")
|
524 |
temp_file_url = "/file=" + temp_file.value['name']
|
525 |
+
html_video = f'<video width={TALKING_HEAD_WIDTH} height={TALKING_HEAD_WIDTH} autoplay><source src={temp_file_url} type="video/mp4" poster="Marc.png"></video>'
|
526 |
else:
|
527 |
print('video url unknown')
|
528 |
return html_video, "videos/tempfile.mp4"
|