shethjenil commited on
Commit
38cf553
·
verified ·
1 Parent(s): 8039ea6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -4
app.py CHANGED
@@ -5,10 +5,8 @@ from musc.model import PretrainedModel
5
  Model = PretrainedModel(instrument='violin').to("cpu")
6
 
7
  def transcribe_and_generate_midi(wav_file_path, model=Model, batch_size=32, postprocessing='spotify'):
8
- midi, _, title = model.transcribe(wav_file_path, batch_size=batch_size, postprocessing=postprocessing)
9
- midi_file_name = unidecode(title) + '.mid'
10
- midi.write(midi_file_name)
11
- return midi_file_name
12
  gr.Interface(
13
  fn=transcribe_and_generate_midi,
14
  inputs=gr.Audio(label="Upload your WAV file",type="filepath"),
 
5
  Model = PretrainedModel(instrument='violin').to("cpu")
6
 
7
  def transcribe_and_generate_midi(wav_file_path, model=Model, batch_size=32, postprocessing='spotify'):
8
+ model.transcribe(wav_file_path, batch_size=batch_size, postprocessing=postprocessing).write("output.mid")
9
+ return "output.mid"
 
 
10
  gr.Interface(
11
  fn=transcribe_and_generate_midi,
12
  inputs=gr.Audio(label="Upload your WAV file",type="filepath"),