OpenSound commited on
Commit
b0ec653
1 Parent(s): 575f48c

Update controlnet_app.py

Browse files
Files changed (1) hide show
  1. controlnet_app.py +2 -0
controlnet_app.py CHANGED
@@ -3,6 +3,7 @@ import random
3
  import numpy as np
4
  import gradio as gr
5
  import librosa
 
6
  from accelerate import Accelerator
7
  from transformers import T5Tokenizer, T5EncoderModel
8
  from diffusers import DDIMScheduler
@@ -70,6 +71,7 @@ device = 'cuda' if torch.cuda.is_available() else 'cpu'
70
  tokenizer, text_encoder, noise_scheduler, params) = load_models(config_name, ckpt_path, controlnet_path, vae_path, device)
71
 
72
 
 
73
  def generate_audio(text,
74
  audio_path, surpass_noise,
75
  guidance_scale, guidance_rescale,
 
3
  import numpy as np
4
  import gradio as gr
5
  import librosa
6
+ import spaces
7
  from accelerate import Accelerator
8
  from transformers import T5Tokenizer, T5EncoderModel
9
  from diffusers import DDIMScheduler
 
71
  tokenizer, text_encoder, noise_scheduler, params) = load_models(config_name, ckpt_path, controlnet_path, vae_path, device)
72
 
73
 
74
+ @spaces.GPU
75
  def generate_audio(text,
76
  audio_path, surpass_noise,
77
  guidance_scale, guidance_rescale,