Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -421,24 +421,46 @@ def validate_and_generate_audio(*args):
|
|
421 |
return None, None, "Please upload at least one PDF file before generating audio."
|
422 |
audio_file, transcript = generate_audio(*args)
|
423 |
return audio_file, transcript, None
|
424 |
-
|
425 |
with gr.Blocks(title="PDF to Audio", css="""
|
426 |
-
|
427 |
-
|
428 |
-
|
429 |
-
|
430 |
-
|
431 |
-
|
432 |
-
|
433 |
-
|
434 |
-
|
435 |
-
|
436 |
-
|
437 |
-
|
438 |
-
|
439 |
-
|
440 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
441 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
442 |
gr.Markdown("First, upload one or more PDFs, select options, then push Generate Audio.\nYou can also select a variety of custom option and direct the way the result is generated.")
|
443 |
submit_btn = gr.Button("Generate Audio", elem_id="submit_btn")
|
444 |
|
|
|
421 |
return None, None, "Please upload at least one PDF file before generating audio."
|
422 |
audio_file, transcript = generate_audio(*args)
|
423 |
return audio_file, transcript, None
|
424 |
+
|
425 |
with gr.Blocks(title="PDF to Audio", css="""
|
426 |
+
#header {
|
427 |
+
display: flex;
|
428 |
+
align-items: center;
|
429 |
+
justify-content: space-between;
|
430 |
+
padding: 20px;
|
431 |
+
background-color: #f0f0f0;
|
432 |
+
border-bottom: 1px solid #ddd;
|
433 |
+
}
|
434 |
+
#title {
|
435 |
+
font-size: 24px;
|
436 |
+
margin: 0;
|
437 |
+
}
|
438 |
+
#logo_container {
|
439 |
+
width: 200px;
|
440 |
+
height: 200px;
|
441 |
+
display: flex;
|
442 |
+
justify-content: center;
|
443 |
+
align-items: center;
|
444 |
+
}
|
445 |
+
#logo_image {
|
446 |
+
max-width: 100%;
|
447 |
+
max-height: 100%;
|
448 |
+
object-fit: contain;
|
449 |
+
}
|
450 |
+
#main_container {
|
451 |
+
margin-top: 20px;
|
452 |
+
}
|
453 |
+
""") as demo:
|
454 |
|
455 |
+
with gr.Row(elem_id="header"):
|
456 |
+
with gr.Column(scale=4):
|
457 |
+
gr.Markdown("# Convert PDFs into an audio podcast, lecture, summary and others", elem_id="title")
|
458 |
+
with gr.Column(scale=1):
|
459 |
+
gr.HTML('''
|
460 |
+
<div id="logo_container">
|
461 |
+
<img src="logo.png" id="logo_image" alt="Logo">
|
462 |
+
</div>
|
463 |
+
''')
|
464 |
gr.Markdown("First, upload one or more PDFs, select options, then push Generate Audio.\nYou can also select a variety of custom option and direct the way the result is generated.")
|
465 |
submit_btn = gr.Button("Generate Audio", elem_id="submit_btn")
|
466 |
|