Update app.py
Browse files
app.py
CHANGED
@@ -164,12 +164,12 @@ with gr.Blocks(theme=gr.themes.Soft()) as demo:
|
|
164 |
# Button is interactive if there's input and progress is 0 or 1 (not in progress)
|
165 |
return gr.Button(interactive=bool(audio) or bool(youtube_url))
|
166 |
|
167 |
-
|
168 |
fn=update_button_state,
|
169 |
inputs=[audio_input, youtube_input],
|
170 |
outputs=run_button
|
171 |
)
|
172 |
-
|
173 |
fn=update_button_state,
|
174 |
inputs=[audio_input, youtube_input],
|
175 |
outputs=run_button
|
@@ -184,7 +184,7 @@ with gr.Blocks(theme=gr.themes.Soft()) as demo:
|
|
184 |
print(f"Error embedding video: {e}")
|
185 |
return ""
|
186 |
|
187 |
-
|
188 |
fn=update_video_embed,
|
189 |
inputs=[youtube_input],
|
190 |
outputs=[video_player]
|
|
|
164 |
# Button is interactive if there's input and progress is 0 or 1 (not in progress)
|
165 |
return gr.Button(interactive=bool(audio) or bool(youtube_url))
|
166 |
|
167 |
+
audio_input.change(
|
168 |
fn=update_button_state,
|
169 |
inputs=[audio_input, youtube_input],
|
170 |
outputs=run_button
|
171 |
)
|
172 |
+
youtube_input.change(
|
173 |
fn=update_button_state,
|
174 |
inputs=[audio_input, youtube_input],
|
175 |
outputs=run_button
|
|
|
184 |
print(f"Error embedding video: {e}")
|
185 |
return ""
|
186 |
|
187 |
+
youtube_input.change(
|
188 |
fn=update_video_embed,
|
189 |
inputs=[youtube_input],
|
190 |
outputs=[video_player]
|