From a84ff25ec16152af13c12f18ae2a68341ee2d582 Mon Sep 17 00:00:00 2001 From: Francois Mazerolle Date: Sun, 7 Apr 2024 15:31:43 -0300 Subject: [PATCH] gradio ompatiblity the .style() methods are no longer supported. The style attributes need to be passed in the preceding method. The 'source' attribute for gr.Image, etc. has been replaced by 'sources' (plural). Note that the requirement.txt file does not specify a version for gradio and so the code needed to be updated as it was no longer working. --- app_sadtalker.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app_sadtalker.py b/app_sadtalker.py index 1401a600..c8989b38 100644 --- a/app_sadtalker.py +++ b/app_sadtalker.py @@ -32,17 +32,17 @@ def sadtalker_demo(checkpoint_path='checkpoints', config_path='src/config', warp Homepage       \ Github ") - with gr.Row().style(equal_height=False): + with gr.Row(equal_height=False): with gr.Column(variant='panel'): with gr.Tabs(elem_id="sadtalker_source_image"): with gr.TabItem('Upload image'): with gr.Row(): - source_image = gr.Image(label="Source image", source="upload", type="filepath", elem_id="img2img_image").style(width=512) + source_image = gr.Image(label="Source image", sources="upload", type="filepath", elem_id="img2img_image", width=512) with gr.Tabs(elem_id="sadtalker_driven_audio"): with gr.TabItem('Upload OR TTS'): with gr.Column(variant='panel'): - driven_audio = gr.Audio(label="Input audio", source="upload", type="filepath") + driven_audio = gr.Audio(label="Input audio", sources="upload", type="filepath") if sys.platform != 'win32' and not in_webui: from src.utils.text2speech import TTSTalker @@ -68,7 +68,7 @@ def sadtalker_demo(checkpoint_path='checkpoints', config_path='src/config', warp submit = gr.Button('Generate', elem_id="sadtalker_generate", variant='primary') with gr.Tabs(elem_id="sadtalker_genearted"): - gen_video = gr.Video(label="Generated video", format="mp4").style(width=256) + gen_video = gr.Video(label="Generated video", format="mp4", width=256) if warpfn: submit.click(