Spaces:
Runtime error
Runtime error
Add simple midi file and test examples for interface.
Browse files- app.py +4 -3
- example-midi/C Major Scale.midi +0 -0
app.py
CHANGED
@@ -51,7 +51,7 @@ def process_midi(midi_file):
|
|
51 |
name = Path(midi_file.name)
|
52 |
|
53 |
# create the model input object
|
54 |
-
item = MusicItem.from_file(name, data.vocab)
|
55 |
|
56 |
# full is the prediction appended to the input
|
57 |
pred, full = learner.predict(item, n_words=100)
|
@@ -72,8 +72,9 @@ def process_midi(midi_file):
|
|
72 |
|
73 |
iface = gr.Interface(
|
74 |
fn=process_midi,
|
75 |
-
inputs="file",
|
76 |
-
outputs="audio"
|
|
|
77 |
)
|
78 |
|
79 |
iface.launch()
|
|
|
51 |
name = Path(midi_file.name)
|
52 |
|
53 |
# create the model input object
|
54 |
+
item = MusicItem.from_file(name, data.vocab)
|
55 |
|
56 |
# full is the prediction appended to the input
|
57 |
pred, full = learner.predict(item, n_words=100)
|
|
|
72 |
|
73 |
iface = gr.Interface(
|
74 |
fn=process_midi,
|
75 |
+
inputs=["file"],
|
76 |
+
outputs="audio",
|
77 |
+
examples=['example-midi/C major scale.midi']
|
78 |
)
|
79 |
|
80 |
iface.launch()
|
example-midi/C Major Scale.midi
ADDED
Binary file (102 Bytes). View file
|
|