lauraibnz commited on
Commit
5d8dc18
1 Parent(s): 0291473

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -1
app.py CHANGED
@@ -16,4 +16,9 @@ controlnet = ControlNetModel.from_pretrained("lauraibnz/midi-audioldm", torch_dt
16
  pipe = AudioLDMControlNetPipeline.from_pretrained("cvssp/audioldm-m-full", controlnet=controlnet, torch_dtype=torch_dtype)
17
  pipe = pipe.to(device)
18
 
19
- audio = pipe("techno", audio_length_in_s=10, num_inference_steps=20, midi=midi, controlnet_conditioning_scale=1.0)
 
 
 
 
 
 
16
  pipe = AudioLDMControlNetPipeline.from_pretrained("cvssp/audioldm-m-full", controlnet=controlnet, torch_dtype=torch_dtype)
17
  pipe = pipe.to(device)
18
 
19
+ def predict(prompt, midi, audio_length_in_s=10, num_inference_steps=20, controlnet_conditioning_scale=1.0):
20
+ audio = pipe(prompt, midi=midi, audio_length_in_s=audio_length_in_s, num_inference_steps=num_inference_steps, controlnet_conditioning_scale=controlnet_conditioning_scale)
21
+ return audio
22
+
23
+ demo = gr.Interface(fn=predict, inputs="prompt", outputs="audio")
24
+ demo.launch()