jerrypan7 commited on
Commit
c78f45d
·
verified ·
1 Parent(s): 7b7ff1b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -0
app.py CHANGED
@@ -131,11 +131,15 @@ with gr.Blocks(theme=gr.themes.Soft()) as demo:
131
  run_button.click(run_asr, inputs=[audio_input, youtube_input], outputs=[result])
132
 
133
  def update_button_state_audio(audio, youtube_url):
 
134
  print(" audio: ",audio, " youtube_url: ", youtube_url)
 
135
  # Button is interactive if there's input and progress is 0 or 1 (not in progress)
136
  return gr.Button(interactive=bool(audio) or bool(youtube_url !=""))
137
  def update_button_state_youtube(audio, youtube_url):
 
138
  print(" youtube: ",audio, " youtube_url: ", youtube_url)
 
139
  # Button is interactive if there's input and progress is 0 or 1 (not in progress)
140
  return gr.Button(interactive=bool(audio) or bool(youtube_url !=""))
141
 
 
131
  run_button.click(run_asr, inputs=[audio_input, youtube_input], outputs=[result])
132
 
133
  def update_button_state_audio(audio, youtube_url):
134
+ global last_modified
135
  print(" audio: ",audio, " youtube_url: ", youtube_url)
136
+ last_modified =1
137
  # Button is interactive if there's input and progress is 0 or 1 (not in progress)
138
  return gr.Button(interactive=bool(audio) or bool(youtube_url !=""))
139
  def update_button_state_youtube(audio, youtube_url):
140
+ global last_modified
141
  print(" youtube: ",audio, " youtube_url: ", youtube_url)
142
+ last_modified=2
143
  # Button is interactive if there's input and progress is 0 or 1 (not in progress)
144
  return gr.Button(interactive=bool(audio) or bool(youtube_url !=""))
145