Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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 |
-
|
|
|
|
|
|
|
|
|
|
|
|
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()
|