Drew commited on
Commit
a8c3afa
1 Parent(s): 88554a6

try using blocks

Browse files
Files changed (1) hide show
  1. app.py +10 -2
app.py CHANGED
@@ -104,9 +104,17 @@ interface = gr.Interface(
104
  description="Generate variable-length stereo audio at 44.1kHz from text prompts using Stable Audio Open 1.0.",
105
  )
106
 
 
 
 
 
 
 
 
 
 
107
 
108
  # Pre-load the model to avoid multiprocessing issues
109
  model, model_config = load_model()
110
 
111
- # Launch the Interface
112
- interface.launch()
 
104
  description="Generate variable-length stereo audio at 44.1kHz from text prompts using Stable Audio Open 1.0.",
105
  )
106
 
107
+ with gr.Blocks() as demo:
108
+ with gr.Tab("Audio"):
109
+ audio_prompt = gr.Textbox(label="Prompt", placeholder="Enter your text prompt here")
110
+ audio_duration = gr.Slider(0, 47, value=30, label="Duration in Seconds")
111
+ audio_steps = gr.Slider(10, 150, value=100, step=10, label="Number of Diffusion Steps")
112
+ audio_cfg = gr.Slider(1, 15, value=7, step=0.1, label="CFG Scale")
113
+ audio_process_button = gr.Button("Process Audio")
114
+ audio_output = gr.Audio(type="filepath", label="Generated Audio")
115
+ audio_process_button.click(generate_audio, [audio_prompt, audio_duration, audio_steps, audio_cfg], [audio_output])
116
 
117
  # Pre-load the model to avoid multiprocessing issues
118
  model, model_config = load_model()
119
 
120
+ demo.launch()