Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -135,23 +135,23 @@ with gr.Blocks() as demo:
|
|
135 |
Generate and mix radio promos effortlessly with AI tools!
|
136 |
""")
|
137 |
|
138 |
-
with gr.
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
|
156 |
with gr.Tab("Step 2: Generate Voice"):
|
157 |
with gr.Row():
|
|
|
135 |
Generate and mix radio promos effortlessly with AI tools!
|
136 |
""")
|
137 |
|
138 |
+
with gr.Tab("Step 1: Generate Script"):
|
139 |
+
with gr.Row():
|
140 |
+
user_prompt = gr.Textbox(label="Promo Idea", placeholder="E.g., A 30-second promo for a morning show.")
|
141 |
+
llama_model_id = gr.Textbox(label="Llama Model ID", value="meta-llama/Meta-Llama-3-8B-Instruct")
|
142 |
+
duration = gr.Slider(label="Duration (seconds)", minimum=15, maximum=60, step=15, value=30)
|
143 |
+
|
144 |
+
generate_script_button = gr.Button("Generate Script")
|
145 |
+
script_output = gr.Textbox(label="Generated Script", lines=5)
|
146 |
+
sound_design_output = gr.Textbox(label="Sound Design", lines=3)
|
147 |
+
music_suggestion_output = gr.Textbox(label="Music Suggestions", lines=3)
|
148 |
+
|
149 |
+
generate_script_button.click(
|
150 |
+
fn=lambda user_prompt, model_id, duration: generate_script(user_prompt, model_id, hf_token, duration),
|
151 |
+
inputs=[user_prompt, llama_model_id, duration], # Gradio components only
|
152 |
+
outputs=[script_output, sound_design_output, music_suggestion_output],
|
153 |
+
)
|
154 |
+
|
155 |
|
156 |
with gr.Tab("Step 2: Generate Voice"):
|
157 |
with gr.Row():
|