VyLala commited on
Commit
a3f7fdf
·
verified ·
1 Parent(s): de2ad87

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +26 -7
app.py CHANGED
@@ -287,13 +287,19 @@ with gr.Blocks() as interface:
287
 
288
 
289
  def make_html_table(rows):
 
 
 
 
 
 
 
290
  html = """
291
- <div style='overflow-x: auto; padding: 10px;'>
292
- <div style='max-height: 400px; overflow-y: auto; border: 1px solid #444; border-radius: 8px;'>
293
- <table style='width:100%; border-collapse: collapse; table-layout: auto; font-size: 14px; color: #f1f1f1; background-color: #1e1e1e;'>
294
- <thead style='position: sticky; top: 0; background-color: #2c2c2c; z-index: 1;'>
295
- <tr>
296
- """
297
  headers = ["Sample ID", "Predicted Country", "Country Explanation", "Predicted Sample Type", "Sample Type Explanation", "Sources", "Time cost"]
298
  html += "".join(
299
  f"<th style='padding: 10px; border: 1px solid #555; text-align: left; white-space: nowrap;'>{h}</th>"
@@ -475,6 +481,19 @@ with gr.Blocks() as interface:
475
  inputs=[raw_text, q1, q2, contact],
476
  outputs=[feedback_status]
477
  )
 
 
 
 
 
 
 
 
 
 
 
 
 
478
  # # Custom CSS styles
479
  # gr.HTML("""
480
  # <style>
@@ -511,4 +530,4 @@ with gr.Blocks() as interface:
511
  # """)
512
 
513
 
514
- interface.launch(share=True,debug=True)
 
287
 
288
 
289
  def make_html_table(rows):
290
+ # html = """
291
+ # <div style='overflow-x: auto; padding: 10px;'>
292
+ # <div style='max-height: 400px; overflow-y: auto; border: 1px solid #444; border-radius: 8px;'>
293
+ # <table style='width:100%; border-collapse: collapse; table-layout: auto; font-size: 14px; color: #f1f1f1; background-color: #1e1e1e;'>
294
+ # <thead style='position: sticky; top: 0; background-color: #2c2c2c; z-index: 1;'>
295
+ # <tr>
296
+ # """
297
  html = """
298
+ <div style='overflow-x: auto; padding: 10px;'>
299
+ <div style='max-height: 400px; overflow-y: auto; border: 1px solid #ccc; border-radius: 8px;'>
300
+ <table style='width:100%; border-collapse: collapse; table-layout: auto; font-size: 14px; color: inherit; background-color: inherit;'>
301
+ """
302
+
 
303
  headers = ["Sample ID", "Predicted Country", "Country Explanation", "Predicted Sample Type", "Sample Type Explanation", "Sources", "Time cost"]
304
  html += "".join(
305
  f"<th style='padding: 10px; border: 1px solid #555; text-align: left; white-space: nowrap;'>{h}</th>"
 
481
  inputs=[raw_text, q1, q2, contact],
482
  outputs=[feedback_status]
483
  )
484
+ gr.HTML("""
485
+ <style>
486
+ body, .gradio-container {
487
+ background-color: #1e1e1e !important;
488
+ color: #f1f1f1 !important;
489
+ }
490
+ table {
491
+ background-color: #1e1e1e !important;
492
+ color: #f1f1f1 !important;
493
+ }
494
+ </style>
495
+ """)
496
+
497
  # # Custom CSS styles
498
  # gr.HTML("""
499
  # <style>
 
530
  # """)
531
 
532
 
533
+ interface.launch(share=True,debug=True, theme=gr.themes.Base().set_dark_mode())