Spaces:
Sleeping
Sleeping
shethjenil
commited on
Update app.py
Browse files
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 |
-
|
9 |
-
|
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"),
|