YinuoGuo27 commited on
Commit
7beb039
·
verified ·
1 Parent(s): 541a02e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -44,7 +44,7 @@ def predict(prompt, upload_reference_audio, microphone_reference_audio, referenc
44
  return gr.Audio(value=output_file_path, type='filepath')
45
 
46
 
47
- def main(sadtaker_checkpoint_path=r"SadTalker/checkpoints", sadtalker_config_path=r"SadTalker/src/config"):
48
  if torch.cuda.is_available():
49
  device = "cuda"
50
  else:
@@ -70,11 +70,11 @@ def main(sadtaker_checkpoint_path=r"SadTalker/checkpoints", sadtalker_config_pat
70
 
71
  with gr.Row():
72
  with gr.Column(variant="panel"):
73
- with gr.Tabs(elem_id="sadtalker_source_image"):
74
  with gr.TabItem("Upload image"):
75
  source_image = gr.Image(label="Source image", sources="upload", type="filepath", scale=256)
76
 
77
- with gr.Tabs(elem_id="sadtalker_driven_audio"):
78
  with gr.TabItem("Upload"):
79
  upload_driven_audio = gr.Audio(label="Upload audio", sources="upload", type="filepath")
80
  upload_driven_audio.change(lambda: "upload", outputs=driven_audio_type)
@@ -90,7 +90,7 @@ def main(sadtaker_checkpoint_path=r"SadTalker/checkpoints", sadtalker_config_pat
90
  lines=5,
91
  placeholder="please enter some text here, we generate the audio from text using @Coqui.ai TTS."
92
  )
93
- tts_button = gr.Button("Generate audio", elem_id="sadtalker_audio_generate", variant="primary")
94
  tts_driven_audio = gr.Audio(label="Synthesised Audio", type="filepath")
95
  tts_button.click(fn=predict, inputs=[input_text, upload_reference_audio, microphone_reference_audio, reference_audio_type], outputs=[tts_driven_audio])
96
  tts_button.click(lambda: "tts", outputs=driven_audio_type)
 
44
  return gr.Audio(value=output_file_path, type='filepath')
45
 
46
 
47
+ def main():
48
  if torch.cuda.is_available():
49
  device = "cuda"
50
  else:
 
70
 
71
  with gr.Row():
72
  with gr.Column(variant="panel"):
73
+ with gr.Tabs(elem_id="kdtalker_source_image"):
74
  with gr.TabItem("Upload image"):
75
  source_image = gr.Image(label="Source image", sources="upload", type="filepath", scale=256)
76
 
77
+ with gr.Tabs(elem_id="kdtalker_driven_audio"):
78
  with gr.TabItem("Upload"):
79
  upload_driven_audio = gr.Audio(label="Upload audio", sources="upload", type="filepath")
80
  upload_driven_audio.change(lambda: "upload", outputs=driven_audio_type)
 
90
  lines=5,
91
  placeholder="please enter some text here, we generate the audio from text using @Coqui.ai TTS."
92
  )
93
+ tts_button = gr.Button("Generate audio", elem_id="kdtalker_audio_generate", variant="primary")
94
  tts_driven_audio = gr.Audio(label="Synthesised Audio", type="filepath")
95
  tts_button.click(fn=predict, inputs=[input_text, upload_reference_audio, microphone_reference_audio, reference_audio_type], outputs=[tts_driven_audio])
96
  tts_button.click(lambda: "tts", outputs=driven_audio_type)