import gradio as gr import os from pathlib import Path os.system("midi_ddsp_download_model_weights") def inference(audio): os.system("midi_ddsp_synthesize --midi_path "+audio.name) return Path(audio.name).stem+"/0_violin.wav" title = "Midi-DDSP" description = "Gradio demo for MIDI-DDSP: \n[NOTICE]: expect instrument {violin} in midi file! You may achieve this by selecting violin in daw then export the midi. \n - Reworked to fix runtime error, based on: https://huggingface.co/spaces/akhaliq/midi-ddsp" article = "
MIDI-DDSP: Detailed Control of Musical Performance via Hierarchical Modeling | Github Repo
" example=['ode_to_joy.mid'] gr.Interface( inference, gr.File(file_types=['.mid','.midi']), "file", title=title, description=description, article=article, enable_queue=True ).launch(debug=True)