Bils commited on
Commit
70d35c8
·
verified ·
1 Parent(s): b50e3e1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +25 -23
app.py CHANGED
@@ -113,30 +113,32 @@ with gr.Blocks() as demo:
113
  gr.Markdown("# 🎧 AI Radio Imaging with Llama 3 + MusicGen (Zero GPU)")
114
 
115
  # Script Generation Section
116
- with gr.Box():
117
- gr.Markdown("## Step 1: Generate the Promo Script")
118
- user_prompt = gr.Textbox(label="Enter your promo idea", placeholder="E.g., A 15-second hype jingle for a morning talk show.")
119
- llama_model_id = gr.Textbox(label="Llama 3 Model ID", value="meta-llama/Meta-Llama-3-70B")
120
- generate_script_button = gr.Button("Generate Promo Script")
121
- script_output = gr.Textbox(label="Generated Script", interactive=False)
122
-
123
- generate_script_button.click(
124
- fn=radio_imaging_script,
125
- inputs=[user_prompt, llama_model_id],
126
- outputs=script_output
127
- )
 
128
 
129
  # Audio Generation Section
130
- with gr.Box():
131
- gr.Markdown("## Step 2: Generate the Sound")
132
- audio_length = gr.Slider(label="Audio Length (tokens)", minimum=128, maximum=1024, step=64, value=512)
133
- generate_audio_button = gr.Button("Generate Sound from Script")
134
- audio_output = gr.Audio(label="Generated Audio", type="filepath")
135
-
136
- generate_audio_button.click(
137
- fn=radio_imaging_audio,
138
- inputs=[script_output, audio_length],
139
- outputs=audio_output
140
- )
 
141
 
142
  demo.launch(debug=True)
 
113
  gr.Markdown("# 🎧 AI Radio Imaging with Llama 3 + MusicGen (Zero GPU)")
114
 
115
  # Script Generation Section
116
+ with gr.Row():
117
+ with gr.Column():
118
+ gr.Markdown("## Step 1: Generate the Promo Script")
119
+ user_prompt = gr.Textbox(label="Enter your promo idea", placeholder="E.g., A 15-second hype jingle for a morning talk show.")
120
+ llama_model_id = gr.Textbox(label="Llama 3 Model ID", value="meta-llama/Meta-Llama-3-70B")
121
+ generate_script_button = gr.Button("Generate Promo Script")
122
+ script_output = gr.Textbox(label="Generated Script", interactive=False)
123
+
124
+ generate_script_button.click(
125
+ fn=radio_imaging_script,
126
+ inputs=[user_prompt, llama_model_id],
127
+ outputs=script_output
128
+ )
129
 
130
  # Audio Generation Section
131
+ with gr.Row():
132
+ with gr.Column():
133
+ gr.Markdown("## Step 2: Generate the Sound")
134
+ audio_length = gr.Slider(label="Audio Length (tokens)", minimum=128, maximum=1024, step=64, value=512)
135
+ generate_audio_button = gr.Button("Generate Sound from Script")
136
+ audio_output = gr.Audio(label="Generated Audio", type="filepath")
137
+
138
+ generate_audio_button.click(
139
+ fn=radio_imaging_audio,
140
+ inputs=[script_output, audio_length],
141
+ outputs=audio_output
142
+ )
143
 
144
  demo.launch(debug=True)