lukewys commited on
Commit
2a32858
β€’
1 Parent(s): 7f00d97

Add application file

Browse files
Files changed (5) hide show
  1. README.md +30 -5
  2. app.py +27 -0
  3. input.mid +0 -0
  4. packages.txt +1 -0
  5. requirements.txt +1 -0
README.md CHANGED
@@ -1,12 +1,37 @@
1
  ---
2
  title: Midi Ddsp
3
- emoji: πŸ’»
4
- colorFrom: yellow
5
- colorTo: gray
6
  sdk: gradio
7
  app_file: app.py
8
  pinned: false
9
- license: apache-2.0
10
  ---
11
 
12
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces#reference
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
  title: Midi Ddsp
3
+ emoji: πŸ‘€
4
+ colorFrom: gray
5
+ colorTo: green
6
  sdk: gradio
7
  app_file: app.py
8
  pinned: false
 
9
  ---
10
 
11
+ # Configuration
12
+
13
+ `title`: _string_
14
+ Display title for the Space
15
+
16
+ `emoji`: _string_
17
+ Space emoji (emoji-only character allowed)
18
+
19
+ `colorFrom`: _string_
20
+ Color for Thumbnail gradient (red, yellow, green, blue, indigo, purple, pink, gray)
21
+
22
+ `colorTo`: _string_
23
+ Color for Thumbnail gradient (red, yellow, green, blue, indigo, purple, pink, gray)
24
+
25
+ `sdk`: _string_
26
+ Can be either `gradio` or `streamlit`
27
+
28
+ `sdk_version` : _string_
29
+ Only applicable for `streamlit` SDK.
30
+ See [doc](https://hf.co/docs/hub/spaces) for more info on supported versions.
31
+
32
+ `app_file`: _string_
33
+ Path to your main application file (which contains either `gradio` or `streamlit` Python code).
34
+ Path is relative to the root of the repository.
35
+
36
+ `pinned`: _boolean_
37
+ Whether the Space stays on top of your list.
app.py ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ import os
3
+ from pathlib import Path
4
+
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 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,
20
+ gr.inputs.File(type="file", label="Input"),
21
+ [gr.outputs.Audio(type="file", label="Output")],
22
+ title=title,
23
+ description=description,
24
+ article=article,
25
+ examples=examples,
26
+ enable_queue=True
27
+ ).launch(debug=True)
input.mid ADDED
Binary file (184 Bytes). View file
 
packages.txt ADDED
@@ -0,0 +1 @@
 
 
1
+ libsndfile1
requirements.txt ADDED
@@ -0,0 +1 @@
 
 
1
+ midi-ddsp