yasserrmd commited on
Commit
21777ef
1 Parent(s): 59438d1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -6,11 +6,13 @@ import gradio as gr
6
 
7
  # Load the StableAudio pipeline model
8
  pipe = StableAudioPipeline.from_pretrained("stabilityai/stable-audio-open-1.0", torch_dtype=torch.float16)
9
- pipe = pipe.to("cuda")
10
 
11
  # Define the function to generate the sound based on a text prompt
12
  @spaces.GPU
13
  def generate_sound(prompt, negative_prompt, seed, inference_steps, duration, waveforms):
 
 
14
  # Set the seed for reproducibility
15
  generator = torch.Generator("cuda").manual_seed(seed)
16
 
 
6
 
7
  # Load the StableAudio pipeline model
8
  pipe = StableAudioPipeline.from_pretrained("stabilityai/stable-audio-open-1.0", torch_dtype=torch.float16)
9
+
10
 
11
  # Define the function to generate the sound based on a text prompt
12
  @spaces.GPU
13
  def generate_sound(prompt, negative_prompt, seed, inference_steps, duration, waveforms):
14
+ pipe = pipe.to("cuda")
15
+
16
  # Set the seed for reproducibility
17
  generator = torch.Generator("cuda").manual_seed(seed)
18