Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -37,19 +37,17 @@ def generate_audio(prompt: str):
|
|
| 37 |
output_path = os.path.join(OUTPUT_PATH, output_filename)
|
| 38 |
sf.write(output_path, output_audio, pipe.vae.sampling_rate)
|
| 39 |
|
| 40 |
-
#
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
return audio_url
|
| 44 |
|
| 45 |
# Gradio Interface setup
|
| 46 |
interface = gr.Interface(
|
| 47 |
-
fn=generate_audio,
|
| 48 |
inputs=gr.Textbox(label="Enter a text prompt to generate audio"),
|
| 49 |
-
outputs=gr.
|
| 50 |
-
title="
|
| 51 |
description="Generate audio from a text prompt using Hugging Face StableAudio Pipeline."
|
| 52 |
)
|
| 53 |
|
| 54 |
-
# Launch the Gradio interface
|
| 55 |
interface.launch(share=True)
|
|
|
|
| 37 |
output_path = os.path.join(OUTPUT_PATH, output_filename)
|
| 38 |
sf.write(output_path, output_audio, pipe.vae.sampling_rate)
|
| 39 |
|
| 40 |
+
# Return the file path so Gradio serves the file
|
| 41 |
+
return output_path
|
|
|
|
|
|
|
| 42 |
|
| 43 |
# Gradio Interface setup
|
| 44 |
interface = gr.Interface(
|
| 45 |
+
fn=generate_audio,
|
| 46 |
inputs=gr.Textbox(label="Enter a text prompt to generate audio"),
|
| 47 |
+
outputs=gr.File(label="Generated Audio File"),
|
| 48 |
+
title="StableAudioText2Speech",
|
| 49 |
description="Generate audio from a text prompt using Hugging Face StableAudio Pipeline."
|
| 50 |
)
|
| 51 |
|
| 52 |
+
# Launch the Gradio interface
|
| 53 |
interface.launch(share=True)
|