Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -29,7 +29,12 @@ os.makedirs(OUTPUT_PATH, exist_ok=True)
|
|
29 |
def generate_audio(prompt: str):
|
30 |
# Generate the audio using StableAudioPipeline
|
31 |
generator = torch.Generator(device).manual_seed(42)
|
32 |
-
audio_output = pipe(prompt=prompt,
|
|
|
|
|
|
|
|
|
|
|
33 |
|
34 |
# Convert to numpy and save to a WAV file
|
35 |
output_audio = audio_output[0].T.float().cpu().numpy()
|
|
|
29 |
def generate_audio(prompt: str):
|
30 |
# Generate the audio using StableAudioPipeline
|
31 |
generator = torch.Generator(device).manual_seed(42)
|
32 |
+
audio_output = pipe(prompt=prompt,
|
33 |
+
negative_prompt='Low Quality',
|
34 |
+
num_inference_steps=int(10), # Number of diffusion steps
|
35 |
+
audio_end_in_s=1,
|
36 |
+
num_waveforms_per_prompt=1,
|
37 |
+
generator=generator).audios
|
38 |
|
39 |
# Convert to numpy and save to a WAV file
|
40 |
output_audio = audio_output[0].T.float().cpu().numpy()
|