fffiloni commited on
Commit
991d60f
1 Parent(s): 54200d7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -2
app.py CHANGED
@@ -1,4 +1,5 @@
1
  import gradio as gr
 
2
  from PIL import Image
3
  import os
4
  token = os.environ.get('HF_TOKEN')
@@ -11,8 +12,11 @@ def infer(audio):
11
  #print(gpt_response)
12
  audio_response = tts(gpt_response[1], "English Text", "English Accent", "English Speaker's Voice", fn_index=0)
13
  #image = Image.open(r"wise_woman_portrait.png")
14
- portrait = talking_face("wise_woman_portrait.png", audio_response, fn_index=0)
15
- return audio_response, portrait
 
 
 
16
 
17
  inputs = gr.Audio(source="microphone",type="filepath")
18
  outputs = [gr.Audio(), gr.Video()]
 
1
  import gradio as gr
2
+ import requests
3
  from PIL import Image
4
  import os
5
  token = os.environ.get('HF_TOKEN')
 
12
  #print(gpt_response)
13
  audio_response = tts(gpt_response[1], "English Text", "English Accent", "English Speaker's Voice", fn_index=0)
14
  #image = Image.open(r"wise_woman_portrait.png")
15
+ portrait_link = talking_face("wise_woman_portrait.png", audio_response, fn_index=0)
16
+
17
+ portrait_response = requests.get(f'{portrait_link}', headers={'Authorization': 'Bearer ' + token})
18
+ print(portrait_response.text)
19
+ return audio_response, portrait_link
20
 
21
  inputs = gr.Audio(source="microphone",type="filepath")
22
  outputs = [gr.Audio(), gr.Video()]