Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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.
|
| 117 |
-
gr.
|
| 118 |
-
|
| 119 |
-
|
| 120 |
-
|
| 121 |
-
|
| 122 |
-
|
| 123 |
-
|
| 124 |
-
|
| 125 |
-
|
| 126 |
-
|
| 127 |
-
|
|
|
|
| 128 |
|
| 129 |
# Audio Generation Section
|
| 130 |
-
with gr.
|
| 131 |
-
gr.
|
| 132 |
-
|
| 133 |
-
|
| 134 |
-
|
| 135 |
-
|
| 136 |
-
|
| 137 |
-
|
| 138 |
-
|
| 139 |
-
|
| 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)
|