Bils commited on
Commit
2547eea
·
verified ·
1 Parent(s): c510040

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +17 -17
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.Tabs():
139
- with gr.Tab("Step 1: Generate Script"):
140
- with gr.Row():
141
- user_prompt = gr.Textbox(label="Promo Idea", placeholder="E.g., A 30-second promo for a morning show.")
142
- llama_model_id = gr.Textbox(label="Llama Model ID", value="meta-llama/Meta-Llama-3-8B-Instruct")
143
- duration = gr.Slider(label="Duration (seconds)", minimum=15, maximum=60, step=15, value=30)
144
-
145
- generate_script_button = gr.Button("Generate Script")
146
- script_output = gr.Textbox(label="Generated Script")
147
- sound_design_output = gr.Textbox(label="Sound Design")
148
- music_suggestion_output = gr.Textbox(label="Music Suggestion")
149
-
150
- generate_script_button.click(
151
- fn=generate_script,
152
- inputs=[user_prompt, llama_model_id, hf_token, duration],
153
- outputs=[script_output, sound_design_output, music_suggestion_output],
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():