Spaces:
Sleeping
Sleeping
Commit
·
76331b9
1
Parent(s):
40bd9d8
Removed debugging statements and hard cap on talking head words
Browse files
app.py
CHANGED
@@ -53,7 +53,7 @@ MAX_TOKENS = 512
|
|
53 |
|
54 |
LOOPING_TALKING_HEAD = "videos/Marc.mp4"
|
55 |
TALKING_HEAD_WIDTH = "192"
|
56 |
-
MAX_TALKING_HEAD_TEXT_LENGTH =
|
57 |
|
58 |
# Pertains to Express-inator functionality
|
59 |
NUM_WORDS_DEFAULT = 0
|
@@ -434,7 +434,7 @@ class ChatWrapper:
|
|
434 |
raise e
|
435 |
finally:
|
436 |
self.lock.release()
|
437 |
-
|
438 |
return history, history, html_video, temp_file, html_audio, temp_aud_file, ""
|
439 |
# return history, history, html_audio, temp_aud_file, ""
|
440 |
|
@@ -494,10 +494,8 @@ def create_html_video(file_name, width):
|
|
494 |
|
495 |
|
496 |
def do_html_video_speak(words_to_speak, azure_language):
|
497 |
-
print('do_html_video_speak called')
|
498 |
azure_voice = AZURE_VOICE_DATA.get_voice(azure_language, "Male")
|
499 |
if not azure_voice:
|
500 |
-
print('No azure_voice detected using default')
|
501 |
azure_voice = "en-US-ChristopherNeural"
|
502 |
|
503 |
headers = {"Authorization": f"Bearer {os.environ['EXHUMAN_API_KEY']}"}
|
@@ -515,7 +513,6 @@ def do_html_video_speak(words_to_speak, azure_language):
|
|
515 |
|
516 |
html_video = '<pre>no video</pre>'
|
517 |
if isinstance(res.content, bytes):
|
518 |
-
print('Starting branch which creates temp video files')
|
519 |
response_stream = io.BytesIO(res.content)
|
520 |
print("len(res.content)): ", len(res.content))
|
521 |
|
@@ -524,8 +521,6 @@ def do_html_video_speak(words_to_speak, azure_language):
|
|
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="Marc.png"></video>'
|
527 |
-
print('Video URL generated: ', temp_file_url)
|
528 |
-
print(html_video)
|
529 |
else:
|
530 |
print('video url unknown')
|
531 |
return html_video, "videos/tempfile.mp4"
|
|
|
53 |
|
54 |
LOOPING_TALKING_HEAD = "videos/Marc.mp4"
|
55 |
TALKING_HEAD_WIDTH = "192"
|
56 |
+
MAX_TALKING_HEAD_TEXT_LENGTH = 1000
|
57 |
|
58 |
# Pertains to Express-inator functionality
|
59 |
NUM_WORDS_DEFAULT = 0
|
|
|
434 |
raise e
|
435 |
finally:
|
436 |
self.lock.release()
|
437 |
+
|
438 |
return history, history, html_video, temp_file, html_audio, temp_aud_file, ""
|
439 |
# return history, history, html_audio, temp_aud_file, ""
|
440 |
|
|
|
494 |
|
495 |
|
496 |
def do_html_video_speak(words_to_speak, azure_language):
|
|
|
497 |
azure_voice = AZURE_VOICE_DATA.get_voice(azure_language, "Male")
|
498 |
if not azure_voice:
|
|
|
499 |
azure_voice = "en-US-ChristopherNeural"
|
500 |
|
501 |
headers = {"Authorization": f"Bearer {os.environ['EXHUMAN_API_KEY']}"}
|
|
|
513 |
|
514 |
html_video = '<pre>no video</pre>'
|
515 |
if isinstance(res.content, bytes):
|
|
|
516 |
response_stream = io.BytesIO(res.content)
|
517 |
print("len(res.content)): ", len(res.content))
|
518 |
|
|
|
521 |
temp_file = gr.File("videos/tempfile.mp4")
|
522 |
temp_file_url = "/file=" + temp_file.value['name']
|
523 |
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>'
|
|
|
|
|
524 |
else:
|
525 |
print('video url unknown')
|
526 |
return html_video, "videos/tempfile.mp4"
|