Fauno15 commited on
Commit
77f3a64
1 Parent(s): 97bb0e0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -6,9 +6,10 @@ import scipy.io.wavfile
6
  def load_model(model_id):
7
  pipeline = DiffusionPipeline.from_pretrained(model_id)
8
  pipeline = pipeline.to("cuda")
 
9
 
10
  def denoise(length_sec,model):
11
- load_model(model)
12
  audios = pipeline(audio_length_in_s=length_sec).audios
13
  for audio in audios:
14
  scipy.io.wavfile.write("test.wav", pipeline.unet.sample_rate, audio.transpose())
 
6
  def load_model(model_id):
7
  pipeline = DiffusionPipeline.from_pretrained(model_id)
8
  pipeline = pipeline.to("cuda")
9
+ return pipeline
10
 
11
  def denoise(length_sec,model):
12
+ pipeline = load_model(model)
13
  audios = pipeline(audio_length_in_s=length_sec).audios
14
  for audio in audios:
15
  scipy.io.wavfile.write("test.wav", pipeline.unet.sample_rate, audio.transpose())