mjbuehler commited on
Commit
890916f
1 Parent(s): 6dcd285

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +38 -16
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
- #main_container {margin-top: 60px;}
427
- #logo {
428
- position: absolute;
429
- top: 10px;
430
- right: 10px;
431
- width: 100px; /* Fixed width */
432
- height: auto; /* Maintain aspect ratio */
433
- max-height: 60px; /* Maximum height */
434
- object-fit: contain; /* Ensure the entire logo is visible */
435
- }
436
- """) as demo:
437
-
438
- with gr.Row():
439
- gr.Markdown("# Convert PDFs into an audio podcast, lecture, summary and others", elem_id="title")
440
- gr.Image("logo.png", elem_id="logo", width=100, height=60) # Specify dimensions here too
 
 
 
 
 
 
 
 
 
 
 
 
 
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