Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -125,17 +125,14 @@ def main():
|
|
125 |
)
|
126 |
with gr.TabItem("Example"):
|
127 |
example_choice = gr.Dropdown(choices=example_choices, label="Choose an example")
|
128 |
-
example_audio_state = gr.State("")
|
129 |
-
example_image_state = gr.State("")
|
130 |
def load_example(choice):
|
131 |
example = example_mapping.get(choice, {})
|
132 |
audio_path = example.get("audio", "")
|
133 |
image_path = example.get("image", "")
|
134 |
-
return audio_path, image_path
|
135 |
example_choice.change(
|
136 |
-
|
137 |
-
inputs=[
|
138 |
-
outputs=[example_audio_state, example_image_state, upload_driven_audio, source_image]
|
139 |
)
|
140 |
example_choice.change(set_upload, outputs=driven_audio_type)
|
141 |
|
|
|
125 |
)
|
126 |
with gr.TabItem("Example"):
|
127 |
example_choice = gr.Dropdown(choices=example_choices, label="Choose an example")
|
|
|
|
|
128 |
def load_example(choice):
|
129 |
example = example_mapping.get(choice, {})
|
130 |
audio_path = example.get("audio", "")
|
131 |
image_path = example.get("image", "")
|
132 |
+
return [audio_path, image_path]
|
133 |
example_choice.change(
|
134 |
+
examples=[load_example(example_choice)],
|
135 |
+
inputs=[example_audio_state, example_image_state, upload_driven_audio, source_image]
|
|
|
136 |
)
|
137 |
example_choice.change(set_upload, outputs=driven_audio_type)
|
138 |
|