Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
import gradio as gr
|
2 |
import os
|
3 |
-
|
4 |
from midi_ddsp.midi_ddsp_synthesize import load_pretrained_model
|
5 |
from midi_ddsp.utils.midi_synthesis_utils import synthesize_mono_midi
|
6 |
from midi_ddsp.data_handling.instrument_name_utils import INST_NAME_TO_ID_DICT, INST_NAME_LIST
|
@@ -19,6 +19,9 @@ def midi_ddsp_synth(instrument, midi_file):
|
|
19 |
fs: the sampling rate
|
20 |
x: the audio data
|
21 |
'''
|
|
|
|
|
|
|
22 |
if not (os.path.isfile(midi_file) and midi_file[-4:] == '.mid'):
|
23 |
raise FileNotFoundError('Error: not a valid midi file')
|
24 |
if instrument not in INST_NAME_LIST:
|
|
|
1 |
import gradio as gr
|
2 |
import os
|
3 |
+
from pathlib import Path
|
4 |
from midi_ddsp.midi_ddsp_synthesize import load_pretrained_model
|
5 |
from midi_ddsp.utils.midi_synthesis_utils import synthesize_mono_midi
|
6 |
from midi_ddsp.data_handling.instrument_name_utils import INST_NAME_TO_ID_DICT, INST_NAME_LIST
|
|
|
19 |
fs: the sampling rate
|
20 |
x: the audio data
|
21 |
'''
|
22 |
+
print(midi_file.name)
|
23 |
+
print(Path(midi_file.name))
|
24 |
+
print(Path(midi_file.name).stem)
|
25 |
if not (os.path.isfile(midi_file) and midi_file[-4:] == '.mid'):
|
26 |
raise FileNotFoundError('Error: not a valid midi file')
|
27 |
if instrument not in INST_NAME_LIST:
|