lukewys commited on
Commit
4eeee10
1 Parent(s): f4c4626

Add application file

Browse files
Files changed (1) hide show
  1. app.py +2 -4
app.py CHANGED
@@ -5,17 +5,15 @@ from pathlib import Path
5
  os.system("midi_ddsp_download_model_weights")
6
 
7
  def inference(audio):
8
- print(Path(audio.name))
9
- print(Path(audio.name).stem)
10
  os.system("midi_ddsp_synthesize --midi_path "+audio.name)
11
- return Path(audio.name).stem+"/0_mix.wav"
12
 
13
  title = "Midi-DDSP"
14
  description = "Gradio demo for MIDI-DDSP: Detailed Control of Musical Performance via Hierarchical Modeling. To use it, simply upload your midi file, or click one of the examples to load them. Read more at the links below."
15
 
16
  article = "<p style='text-align: center'><a href='https://arxiv.org/abs/2112.09312' target='_blank'>MIDI-DDSP: Detailed Control of Musical Performance via Hierarchical Modeling</a> | <a href='https://github.com/magenta/midi-ddsp' target='_blank'>Github Repo</a></p>"
17
 
18
- examples=[[f'os.path.dirname(os.path.abspath(__file__))/input.mid']]
19
 
20
  gr.Interface(
21
  inference,
 
5
  os.system("midi_ddsp_download_model_weights")
6
 
7
  def inference(audio):
 
 
8
  os.system("midi_ddsp_synthesize --midi_path "+audio.name)
9
+ return f'{os.path.dirname(os.path.abspath(__file__))}+{Path(audio.name).stem}+/0_mix.wav'
10
 
11
  title = "Midi-DDSP"
12
  description = "Gradio demo for MIDI-DDSP: Detailed Control of Musical Performance via Hierarchical Modeling. To use it, simply upload your midi file, or click one of the examples to load them. Read more at the links below."
13
 
14
  article = "<p style='text-align: center'><a href='https://arxiv.org/abs/2112.09312' target='_blank'>MIDI-DDSP: Detailed Control of Musical Performance via Hierarchical Modeling</a> | <a href='https://github.com/magenta/midi-ddsp' target='_blank'>Github Repo</a></p>"
15
 
16
+ examples=['input.mid']
17
 
18
  gr.Interface(
19
  inference,