Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
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 |
-
|
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 |
|