Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,4 +1,5 @@
|
|
1 |
import gradio as gr
|
|
|
2 |
from diffusers import DiffusionPipeline
|
3 |
|
4 |
model_id = "harmonai/maestro-150k"
|
@@ -7,6 +8,7 @@ pipeline = pipeline.to("cuda")
|
|
7 |
|
8 |
def denoise(length_sec):
|
9 |
audios = pipeline(audio_length_in_s=length_sec).audios
|
10 |
-
|
|
|
11 |
|
12 |
gr.Interface(fn=denoise, inputs=gr.Slider(1.0, 6.0, value=3.0, step=0.5, label="Audio length in seconds"), outputs="audio").launch()
|
|
|
1 |
import gradio as gr
|
2 |
+
import scipy
|
3 |
from diffusers import DiffusionPipeline
|
4 |
|
5 |
model_id = "harmonai/maestro-150k"
|
|
|
8 |
|
9 |
def denoise(length_sec):
|
10 |
audios = pipeline(audio_length_in_s=length_sec).audios
|
11 |
+
scipy.io.wavfile.write("maestro_test.wav", pipeline.unet.sample_rate, audios)
|
12 |
+
return "maestro_test.wav"
|
13 |
|
14 |
gr.Interface(fn=denoise, inputs=gr.Slider(1.0, 6.0, value=3.0, step=0.5, label="Audio length in seconds"), outputs="audio").launch()
|