Fauno15 commited on
Commit
4a0f7d0
1 Parent(s): 8b1c93c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -4
app.py CHANGED
@@ -1,13 +1,12 @@
1
  import gradio as gr
2
  from diffusers import DiffusionPipeline
3
- import scipy
4
 
5
  model_id = "harmonai/maestro-150k"
6
  pipeline = DiffusionPipeline.from_pretrained(model_id)
7
  pipeline = pipeline.to("cuda")
8
 
9
- def denoise(text):
10
- audios = pipeline(audio_length_in_s=1.0).audios
11
  return audios
12
 
13
- gr.Interface(fn=denoise, inputs="text", outputs="audio").launch()
 
1
  import gradio as gr
2
  from diffusers import DiffusionPipeline
 
3
 
4
  model_id = "harmonai/maestro-150k"
5
  pipeline = DiffusionPipeline.from_pretrained(model_id)
6
  pipeline = pipeline.to("cuda")
7
 
8
+ def denoise(length_sec):
9
+ audios = pipeline(audio_length_in_s=length_sec).audios
10
  return audios
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()