bluenevus commited on
Commit
bc010fb
·
verified ·
1 Parent(s): 23019f5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +96 -81
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.Card([
158
- dbc.CardBody([
159
- dbc.Textarea(id="content-input", placeholder="Paste your content or upload a document", rows=5, className="my-3"),
160
- dcc.Upload(
161
- id='document-upload',
162
- children=html.Div(['Drag and Drop or ', html.A('Select a File')]),
163
- style={
164
- 'width': '100%',
165
- 'height': '60px',
166
- 'lineHeight': '60px',
167
- 'borderWidth': '1px',
168
- 'borderStyle': 'dashed',
169
- 'borderRadius': '5px',
170
- 'textAlign': 'center',
171
- 'margin': '10px 0'
172
- }
173
- ),
174
- dbc.RadioItems(
175
- id="duration",
176
- options=[
177
- {"label": "1-5 min", "value": "1-5 min"},
178
- {"label": "5-10 min", "value": "5-10 min"},
179
- {"label": "10-15 min", "value": "10-15 min"}
180
- ],
181
- value="1-5 min",
182
- inline=True,
183
- className="my-3"
184
- ),
185
- dbc.RadioItems(
186
- id="num-hosts",
187
- options=[
188
- {"label": "1 host", "value": 1},
189
- {"label": "2 hosts", "value": 2}
190
- ],
191
- value=2,
192
- inline=True,
193
- className="my-3"
194
- ),
195
- dbc.Select(
196
- id="lang1-select",
197
- options=[{"label": lang, "value": lang} for lang in language_names.values()],
198
- value="English (United States)",
199
- className="my-2"
200
- ),
201
- dbc.Select(
202
- id="voice1-select",
203
- value="en-US, AvaNeural",
204
- className="my-2"
205
- ),
206
- dbc.Select(
207
- id="lang2-select",
208
- options=[{"label": lang, "value": lang} for lang in language_names.values()],
209
- value="English (United States)",
210
- className="my-2"
211
- ),
212
- dbc.Select(
213
- id="voice2-select",
214
- value="en-US, BrianNeural",
215
- className="my-2"
216
- ),
217
- dbc.Button("Generate Script", id="generate-btn", color="primary", className="mt-3"),
218
- dcc.Loading(
219
- id="loading-script",
220
- type="default",
221
- children=[
222
- dbc.Progress(id="script-progress", value=0, className="my-3"),
223
- dbc.Textarea(id="script-output", rows=10, className="my-3"),
224
- ]
225
- ),
226
- dbc.Button("Generate Podcast", id="generate-podcast-btn", color="success", className="mt-3"),
227
- dcc.Loading(
228
- id="loading-podcast",
229
- type="default",
230
- children=[
231
- dbc.Progress(id="podcast-progress", value=0, className="my-3"),
232
- html.Div(id="audio-output", className="my-3"),
233
- ]
234
- ),
235
- dcc.Download(id="download-audio")
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)