OnyxMunk commited on
Commit
c02a65c
·
verified ·
1 Parent(s): 7b59a22

syntax and indentation errors correction

Browse files

If there is a editing error in the script start here.. I did this my self and something doesn't feel solid about it? lol

Files changed (1) hide show
  1. demos/musicgen_app.py +51 -15
demos/musicgen_app.py CHANGED
@@ -401,41 +401,77 @@ def ui_batched(launch_kwargs):
401
  with gr.Row():
402
  with gr.Column():
403
  with gr.Row():
404
- text = gr.Text(label="Describe your music", lines=2, interactive=True)
 
405
  with gr.Column():
406
- radio = gr.Radio(["file", "mic"], value="file",
407
- label="Condition on a melody (optional) File or Mic")
408
- melody = gr.Audio(sources=["upload"], type="numpy", label="File",
409
- interactive=True, elem_id="melody-input")
 
 
 
 
 
 
 
 
 
410
  with gr.Row():
411
  submit = gr.Button("Generate")
412
  with gr.Column():
413
- output = gr.Audio(label="Generated Music", type='filepath')
414
- audio_output = gr.Audio(label="Generated Music (wav)", type='filepath')
415
- submit.click(predict_batched, inputs=[text, melody],
416
- outputs=[output, audio_output], batch=True, max_batch_size=MAX_BATCH_SIZE)
417
- radio.change(toggle_audio_src, radio, [melody], queue=False, show_progress=False)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
418
  gr.Examples(
419
  fn=predict_batched,
420
  examples=[
421
  [
422
- "An 80s driving pop song with heavy drums and synth pads in the background",
 
423
  "./assets/bach.mp3",
424
  ],
425
  [
426
- "A cheerful country song with acoustic guitars",
 
427
  "./assets/bolero_ravel.mp3",
428
  ],
429
  [
430
- "90s rock song with electric guitar and heavy drums",
 
431
  None,
432
  ],
433
  [
434
- "a light and cheerly EDM track, with syncopated drums, aery pads, and strong emotions bpm: 130",
 
 
435
  "./assets/bach.mp3",
436
  ],
437
  [
438
- "lofi slow bpm electro chill with organic samples",
 
439
  None,
440
  ],
441
  ],
 
401
  with gr.Row():
402
  with gr.Column():
403
  with gr.Row():
404
+ text = gr.Text(label="Describe
405
+ your music", lines=2, interactive=True)
406
  with gr.Column():
407
+ radio = gr.Radio(
408
+ ["file", "mic"],
409
+ value="file",
410
+ label="Condition on a
411
+ melody (optional) File or Mic",
412
+ )
413
+ melody = gr.Audio(
414
+ sources=["upload"],
415
+ type="numpy",
416
+ label="File",
417
+ interactive=True,
418
+ elem_id="melody-input",
419
+ )
420
  with gr.Row():
421
  submit = gr.Button("Generate")
422
  with gr.Column():
423
+ output = gr.Audio(
424
+ label="Generated Music",
425
+ type='filepath',
426
+ )
427
+ audio_output = gr.Audio(
428
+ label="Generated Music (wav)",
429
+ type='filepath',
430
+ )
431
+
432
+ submit.click(
433
+ predict_batched,
434
+ inputs=[text, melody],
435
+ outputs=[output, audio_output],
436
+ batch=True,
437
+ max_batch_size=MAX_BATCH_SIZE,
438
+ )
439
+
440
+ radio.change(
441
+ toggle_audio_src,
442
+ radio,
443
+ [melody],
444
+ queue=False,
445
+ show_progress=False,
446
+ )
447
+
448
  gr.Examples(
449
  fn=predict_batched,
450
  examples=[
451
  [
452
+ "An 80s driving pop song with
453
+ heavy drums and synth pads in the background",
454
  "./assets/bach.mp3",
455
  ],
456
  [
457
+ "A cheerful country song with
458
+ acoustic guitars",
459
  "./assets/bolero_ravel.mp3",
460
  ],
461
  [
462
+ "90s rock song with electric
463
+ guitar and heavy drums",
464
  None,
465
  ],
466
  [
467
+ "a light and cheerly EDM track,
468
+ with syncopated drums, aery pads, and strong
469
+ emotions bpm: 130",
470
  "./assets/bach.mp3",
471
  ],
472
  [
473
+ "lofi slow bpm electro chill with
474
+ organic samples",
475
  None,
476
  ],
477
  ],