dx2102 commited on
Commit
8e429aa
·
verified ·
1 Parent(s): ea123d1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -3
app.py CHANGED
@@ -103,7 +103,10 @@ with gr.Blocks() as demo:
103
  midi_box = gr.File()
104
  piano_roll_box = gr.Image()
105
  example_box = gr.Examples(
106
- [["Chopin"], ["Bach"], ["Beethoven"], ["Debussy"], ["Nocturne"], ["Clair De Lune"], ["Guitar"], ["Boogie Woogie"], [example_prefix]],
 
 
 
107
  inputs=prefix_box,
108
  )
109
 
@@ -146,10 +149,10 @@ with gr.Blocks() as demo:
146
  prefix_box.submit(user_fn, [prefix_box, chatbot_box], [prefix_box, chatbot_box], queue=False).then(
147
  bot_fn, chatbot_box, chatbot_box
148
  )
149
- submit_btn.click(user_fn, [prefix_box, chatbot_box], [prefix_box, chatbot_box], queue=False).then(
150
  bot_fn, chatbot_box, chatbot_box
151
  )
152
- clear_btn.click(lambda: None, None, chatbot_box, queue=False)
153
 
154
  def get_audio_fn(history):
155
  i = random.randint(0, 1000_000_000)
 
103
  midi_box = gr.File()
104
  piano_roll_box = gr.Image()
105
  example_box = gr.Examples(
106
+ [
107
+ ["Chopin"], ["Bach"], ["Beethoven"], ["Debussy"], ["Nocturne"], ["Clair De Lune"], ["Guitar"], ["Boogie Woogie"],
108
+ ["Fugue I in C major, BWV 846"], ["Beethoven Symphony No. 7 (2nd movement) Piano solo"], [example_prefix],
109
+ ],
110
  inputs=prefix_box,
111
  )
112
 
 
149
  prefix_box.submit(user_fn, [prefix_box, chatbot_box], [prefix_box, chatbot_box], queue=False).then(
150
  bot_fn, chatbot_box, chatbot_box
151
  )
152
+ submit_event = submit_btn.click(user_fn, [prefix_box, chatbot_box], [prefix_box, chatbot_box], queue=False).then(
153
  bot_fn, chatbot_box, chatbot_box
154
  )
155
+ clear_btn.click(lambda: None, None, inputs=[], outputs=chatbot_box, cancels=[submit_event], queue=False)
156
 
157
  def get_audio_fn(history):
158
  i = random.randint(0, 1000_000_000)