psistolar commited on
Commit
a099098
1 Parent(s): d02a40d

Add simple midi file and test examples for interface.

Browse files
Files changed (2) hide show
  1. app.py +4 -3
  2. 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