Update app.py
Browse files
app.py
CHANGED
@@ -150,91 +150,106 @@ language_names = {
|
|
150 |
# Get voice list (this should be run once at startup)
|
151 |
voice_dict = asyncio.run(get_voice_list())
|
152 |
|
|
|
|
|
153 |
# Layout
|
154 |
app.layout = dbc.Container([
|
155 |
html.H1("AI Podcast Generator", className="my-4"),
|
156 |
|
157 |
-
dbc.
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
]
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
238 |
], fluid=True)
|
239 |
|
240 |
# Callbacks (continued)
|
|
|
150 |
# Get voice list (this should be run once at startup)
|
151 |
voice_dict = asyncio.run(get_voice_list())
|
152 |
|
153 |
+
# Layout
|
154 |
+
|
155 |
# Layout
|
156 |
app.layout = dbc.Container([
|
157 |
html.H1("AI Podcast Generator", className="my-4"),
|
158 |
|
159 |
+
dbc.Row([
|
160 |
+
# Left Column
|
161 |
+
dbc.Col([
|
162 |
+
dbc.Card([
|
163 |
+
dbc.CardBody([
|
164 |
+
dcc.Loading(
|
165 |
+
id="loading-script",
|
166 |
+
type="default",
|
167 |
+
children=[
|
168 |
+
dbc.Progress(id="script-progress", value=0, className="my-3"),
|
169 |
+
dbc.Textarea(id="script-output", rows=20, className="my-3"),
|
170 |
+
]
|
171 |
+
),
|
172 |
+
dbc.Button("Generate Podcast", id="generate-podcast-btn", color="success", className="mt-3"),
|
173 |
+
dcc.Loading(
|
174 |
+
id="loading-podcast",
|
175 |
+
type="default",
|
176 |
+
children=[
|
177 |
+
dbc.Progress(id="podcast-progress", value=0, className="my-3"),
|
178 |
+
html.Div(id="audio-output", className="my-3"),
|
179 |
+
]
|
180 |
+
),
|
181 |
+
dcc.Download(id="download-audio")
|
182 |
+
])
|
183 |
+
])
|
184 |
+
], width=5), # Adjust the width as needed
|
185 |
+
|
186 |
+
# Right Column
|
187 |
+
dbc.Col([
|
188 |
+
dbc.Card([
|
189 |
+
dbc.CardBody([
|
190 |
+
dbc.Textarea(id="content-input", placeholder="Paste your content or upload a document", rows=5, className="my-3"),
|
191 |
+
dcc.Upload(
|
192 |
+
id='document-upload',
|
193 |
+
children=html.Div(['Drag and Drop or ', html.A('Select a File')]),
|
194 |
+
style={
|
195 |
+
'width': '100%',
|
196 |
+
'height': '60px',
|
197 |
+
'lineHeight': '60px',
|
198 |
+
'borderWidth': '1px',
|
199 |
+
'borderStyle': 'dashed',
|
200 |
+
'borderRadius': '5px',
|
201 |
+
'textAlign': 'center',
|
202 |
+
'margin': '10px 0'
|
203 |
+
}
|
204 |
+
),
|
205 |
+
dbc.RadioItems(
|
206 |
+
id="duration",
|
207 |
+
options=[
|
208 |
+
{"label": "1-5 min", "value": "1-5 min"},
|
209 |
+
{"label": "5-10 min", "value": "5-10 min"},
|
210 |
+
{"label": "10-15 min", "value": "10-15 min"}
|
211 |
+
],
|
212 |
+
value="1-5 min",
|
213 |
+
inline=True,
|
214 |
+
className="my-3"
|
215 |
+
),
|
216 |
+
dbc.RadioItems(
|
217 |
+
id="num-hosts",
|
218 |
+
options=[
|
219 |
+
{"label": "1 host", "value": 1},
|
220 |
+
{"label": "2 hosts", "value": 2}
|
221 |
+
],
|
222 |
+
value=2,
|
223 |
+
inline=True,
|
224 |
+
className="my-3"
|
225 |
+
),
|
226 |
+
dbc.Select(
|
227 |
+
id="lang1-select",
|
228 |
+
options=[{"label": lang, "value": lang} for lang in language_names.values()],
|
229 |
+
value="English (United States)",
|
230 |
+
className="my-2"
|
231 |
+
),
|
232 |
+
dbc.Select(
|
233 |
+
id="voice1-select",
|
234 |
+
value="en-US-AriaNeural",
|
235 |
+
className="my-2"
|
236 |
+
),
|
237 |
+
dbc.Select(
|
238 |
+
id="lang2-select",
|
239 |
+
options=[{"label": lang, "value": lang} for lang in language_names.values()],
|
240 |
+
value="English (United States)",
|
241 |
+
className="my-2"
|
242 |
+
),
|
243 |
+
dbc.Select(
|
244 |
+
id="voice2-select",
|
245 |
+
value="en-US-BrianNeural",
|
246 |
+
className="my-2"
|
247 |
+
),
|
248 |
+
dbc.Button("Generate Script", id="generate-btn", color="primary", className="mt-3"),
|
249 |
+
])
|
250 |
+
])
|
251 |
+
], width=7), # Adjust the width as needed
|
252 |
+
]),
|
253 |
], fluid=True)
|
254 |
|
255 |
# Callbacks (continued)
|