asigalov61 commited on
Commit
56ab42f
1 Parent(s): 28aa919

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -34
app.py CHANGED
@@ -215,47 +215,19 @@ if __name__ == "__main__":
215
 
216
  js_msg = JSMsgReceiver()
217
 
218
- input_model = gr.Dropdown(label="select model", choices=["test0", "test1"],
219
- type="value", value="test0")
220
-
221
- tab_select = gr.Number(value=0, label='tab select')
222
-
223
  with gr.Tabs():
224
  with gr.TabItem("instrument prompt") as tab1:
225
- input_instruments = gr.Dropdown(label="instruments (auto if empty)", choices=list(patch2number.keys()),
226
- multiselect=True, max_choices=15, type="value")
227
- input_drum_kit = gr.Dropdown(label="drum kit", choices=list(drum_kits2number.keys()), type="value",
228
- value="None")
229
- example1 = gr.Examples([
230
- [[], "None"],
231
- [["Acoustic Grand"], "None"],
232
- [["Acoustic Grand", "Violin", "Viola", "Cello", "Contrabass"], "Orchestra"],
233
- [["Flute", "Cello", "Bassoon", "Tuba"], "None"],
234
- [["Violin", "Viola", "Cello", "Contrabass", "Trumpet", "French Horn", "Brass Section",
235
- "Flute", "Piccolo", "Tuba", "Trombone", "Timpani"], "Orchestra"],
236
- [["Acoustic Guitar(nylon)", "Acoustic Guitar(steel)", "Electric Guitar(jazz)",
237
- "Electric Guitar(clean)", "Electric Guitar(muted)", "Overdriven Guitar", "Distortion Guitar",
238
- "Electric Bass(finger)"], "Standard"]
239
- ], [input_instruments, input_drum_kit])
240
  with gr.TabItem("midi prompt") as tab2:
241
  input_midi = gr.File(label="input midi", file_types=[".midi", ".mid"], type="binary")
242
- input_midi_events = gr.Slider(label="use first n midi events as prompt", minimum=1, maximum=512,
243
- step=1,
244
- value=128)
245
- example2 = gr.Examples([[file, 128] for file in glob.glob("example/*.mid")],
246
- [input_midi, input_midi_events])
247
 
248
- tab1.select(lambda: 0, None, tab_select, queue=False)
249
- tab2.select(lambda: 1, None, tab_select, queue=False)
250
- input_gen_events = gr.Slider(label="generate n midi events", minimum=1, maximum=opt.max_gen,
251
- step=1, value=opt.max_gen // 2)
252
  with gr.Accordion("options", open=False):
253
- input_temp = gr.Slider(label="temperature", minimum=0.1, maximum=1.2, step=0.01, value=1)
254
- input_top_p = gr.Slider(label="top p", minimum=0.1, maximum=1, step=0.01, value=0.98)
255
- input_top_k = gr.Slider(label="top k", minimum=1, maximum=20, step=1, value=12)
256
  input_allow_cc = gr.Checkbox(label="allow midi cc event", value=True)
257
- example3 = gr.Examples([[1, 0.98, 12], [1.2, 0.95, 8]], [input_temp, input_top_p, input_top_k])
258
- run_btn = gr.Button("generate", variant="primary")
259
  stop_btn = gr.Button("stop and output")
260
  output_midi_seq = gr.Textbox()
261
  output_midi_visualizer = gr.HTML(elem_id="midi_visualizer_container")
 
215
 
216
  js_msg = JSMsgReceiver()
217
 
 
 
 
 
 
218
  with gr.Tabs():
219
  with gr.TabItem("instrument prompt") as tab1:
220
+
221
+ search_prompt = gr.Textbox(label="search prompt")
222
+
 
 
 
 
 
 
 
 
 
 
 
 
223
  with gr.TabItem("midi prompt") as tab2:
224
  input_midi = gr.File(label="input midi", file_types=[".midi", ".mid"], type="binary")
 
 
 
 
 
225
 
 
 
 
 
226
  with gr.Accordion("options", open=False):
227
+
 
 
228
  input_allow_cc = gr.Checkbox(label="allow midi cc event", value=True)
229
+
230
+ search_btn = gr.Button("search", variant="primary")
231
  stop_btn = gr.Button("stop and output")
232
  output_midi_seq = gr.Textbox()
233
  output_midi_visualizer = gr.HTML(elem_id="midi_visualizer_container")