raksama19 commited on
Commit
98cf91f
Β·
verified Β·
1 Parent(s): b2d91c3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +21 -1
app.py CHANGED
@@ -404,6 +404,10 @@ with gr.Blocks(
404
  h1, h2, h3 {
405
  font-weight: 700 !important;
406
  }
 
 
 
 
407
  """
408
  ) as demo:
409
 
@@ -443,6 +447,13 @@ with gr.Blocks(
443
  "Upload a PDF to get started",
444
  elem_classes="status-message"
445
  )
 
 
 
 
 
 
 
446
 
447
  # Results Tab (initially hidden)
448
  with gr.TabItem("πŸ“– Document", id="results", visible=False) as results_tab:
@@ -485,11 +496,17 @@ with gr.Blocks(
485
  process_btn.click(
486
  fn=start_processing,
487
  outputs=[status_output, results_tab]
 
 
 
488
  ).then(
489
  fn=process_uploaded_pdf,
490
  inputs=[pdf_input],
491
  outputs=[status_output, results_tab],
492
- show_progress=True
 
 
 
493
  ).then(
494
  fn=get_processed_markdown,
495
  outputs=[markdown_display]
@@ -501,6 +518,9 @@ with gr.Blocks(
501
  clear_btn.click(
502
  fn=clear_all,
503
  outputs=[pdf_input, status_output, results_tab]
 
 
 
504
  ).then(
505
  fn=lambda: gr.TabItem(visible=False),
506
  outputs=[chat_tab]
 
404
  h1, h2, h3 {
405
  font-weight: 700 !important;
406
  }
407
+ #progress-container {
408
+ margin: 10px 0;
409
+ min-height: 20px;
410
+ }
411
  """
412
  ) as demo:
413
 
 
447
  "Upload a PDF to get started",
448
  elem_classes="status-message"
449
  )
450
+
451
+ # Dedicated progress space
452
+ progress_space = gr.HTML(
453
+ value="",
454
+ visible=False,
455
+ elem_id="progress-container"
456
+ )
457
 
458
  # Results Tab (initially hidden)
459
  with gr.TabItem("πŸ“– Document", id="results", visible=False) as results_tab:
 
496
  process_btn.click(
497
  fn=start_processing,
498
  outputs=[status_output, results_tab]
499
+ ).then(
500
+ fn=lambda: gr.HTML(visible=True),
501
+ outputs=[progress_space]
502
  ).then(
503
  fn=process_uploaded_pdf,
504
  inputs=[pdf_input],
505
  outputs=[status_output, results_tab],
506
+ show_progress="full"
507
+ ).then(
508
+ fn=lambda: gr.HTML(visible=False),
509
+ outputs=[progress_space]
510
  ).then(
511
  fn=get_processed_markdown,
512
  outputs=[markdown_display]
 
518
  clear_btn.click(
519
  fn=clear_all,
520
  outputs=[pdf_input, status_output, results_tab]
521
+ ).then(
522
+ fn=lambda: gr.HTML(visible=False),
523
+ outputs=[progress_space]
524
  ).then(
525
  fn=lambda: gr.TabItem(visible=False),
526
  outputs=[chat_tab]