rocky250 commited on
Commit
77427f3
Β·
verified Β·
1 Parent(s): 7bb49de

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +26 -10
app.py CHANGED
@@ -84,6 +84,9 @@ input[type="range"] { accent-color: var(--cyan); }
84
  .gr-dataframe td { color: var(--text) !important; font-size: 0.78rem !important; padding: 5px 10px; border-bottom: 1px solid var(--border); }
85
  .gr-dataframe tr:hover td { background: rgba(0,212,255,0.04) !important; }
86
 
 
 
 
87
  /* Shared HTML helpers */
88
  .vv-hero { font-family: 'Syne', sans-serif; font-size: 1.6rem; font-weight: 800; background: linear-gradient(135deg, #00d4ff, #4a8eff); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; letter-spacing: -0.02em; line-height: 1.2; }
89
  .vv-section-title { font-family: 'Syne', sans-serif; font-size: 0.68rem; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase; color: #5a6070; margin-bottom: 0.5rem; }
@@ -418,9 +421,10 @@ def pick_and_analyze(selected_url, api_key, sentiment_method, max_comments):
418
 
419
  # ══════════════════════════════════════════════════════════════════════════════
420
  # GRADIO BLOCKS UI
 
421
  # ══════════════════════════════════════════════════════════════════════════════
422
 
423
- with gr.Blocks(css=CSS, title="VideoVerifier β€” MHMisinfo", theme=gr.themes.Base()) as demo:
424
 
425
  # ── Header ────────────────────────────────────────────────────────────────
426
  gr.HTML("""
@@ -544,18 +548,24 @@ with gr.Blocks(css=CSS, title="VideoVerifier β€” MHMisinfo", theme=gr.themes.Bas
544
  # Comments deep-dive
545
  gr.HTML('<p class="vv-section-title">πŸ“Š Comments Deep-Dive</p>')
546
  with gr.Tabs():
 
 
547
  with gr.TabItem("All"):
548
- df_all_out = gr.Dataframe(
549
- headers=["author","text","likes","published_at","sentiment","compound"],
550
- datatype=["str","str","number","str","str","number"],
551
- wrap=True, height=320,
552
- )
 
553
  with gr.TabItem("Positive"):
554
- df_pos_out = gr.Dataframe(wrap=True, height=320)
 
555
  with gr.TabItem("Negative"):
556
- df_neg_out = gr.Dataframe(wrap=True, height=320)
 
557
  with gr.TabItem("Most Liked"):
558
- df_top_out = gr.Dataframe(wrap=True, height=320)
 
559
 
560
  # ── Activity log ──────────────────────────────────────────────────────────
561
  with gr.Accordion("πŸ“œ Activity Log", open=False):
@@ -617,6 +627,12 @@ with gr.Blocks(css=CSS, title="VideoVerifier β€” MHMisinfo", theme=gr.themes.Bas
617
  outputs=ALL_OUTPUTS,
618
  )
619
 
 
 
620
  # ══════════════════════════════════════════════════════════════════════════════
621
  if __name__ == "__main__":
622
- demo.launch(show_api=False)
 
 
 
 
 
84
  .gr-dataframe td { color: var(--text) !important; font-size: 0.78rem !important; padding: 5px 10px; border-bottom: 1px solid var(--border); }
85
  .gr-dataframe tr:hover td { background: rgba(0,212,255,0.04) !important; }
86
 
87
+ /* Dataframe container height shim (replaces removed height= param) */
88
+ .df-container { max-height: 320px; overflow-y: auto; border-radius: 8px; }
89
+
90
  /* Shared HTML helpers */
91
  .vv-hero { font-family: 'Syne', sans-serif; font-size: 1.6rem; font-weight: 800; background: linear-gradient(135deg, #00d4ff, #4a8eff); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; letter-spacing: -0.02em; line-height: 1.2; }
92
  .vv-section-title { font-family: 'Syne', sans-serif; font-size: 0.68rem; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase; color: #5a6070; margin-bottom: 0.5rem; }
 
421
 
422
  # ══════════════════════════════════════════════════════════════════════════════
423
  # GRADIO BLOCKS UI
424
+ # FIX 1: Removed css= and theme= from gr.Blocks() β€” passed to launch() instead.
425
  # ══════════════════════════════════════════════════════════════════════════════
426
 
427
+ with gr.Blocks(title="VideoVerifier β€” MHMisinfo") as demo:
428
 
429
  # ── Header ────────────────────────────────────────────────────────────────
430
  gr.HTML("""
 
548
  # Comments deep-dive
549
  gr.HTML('<p class="vv-section-title">πŸ“Š Comments Deep-Dive</p>')
550
  with gr.Tabs():
551
+ # FIX 2: Removed height=320 from all gr.Dataframe calls.
552
+ # Vertical scrolling is handled by the .df-container CSS class defined above.
553
  with gr.TabItem("All"):
554
+ with gr.Group(elem_classes="df-container"):
555
+ df_all_out = gr.Dataframe(
556
+ headers=["author","text","likes","published_at","sentiment","compound"],
557
+ datatype=["str","str","number","str","str","number"],
558
+ wrap=True,
559
+ )
560
  with gr.TabItem("Positive"):
561
+ with gr.Group(elem_classes="df-container"):
562
+ df_pos_out = gr.Dataframe(wrap=True)
563
  with gr.TabItem("Negative"):
564
+ with gr.Group(elem_classes="df-container"):
565
+ df_neg_out = gr.Dataframe(wrap=True)
566
  with gr.TabItem("Most Liked"):
567
+ with gr.Group(elem_classes="df-container"):
568
+ df_top_out = gr.Dataframe(wrap=True)
569
 
570
  # ── Activity log ──────────────────────────────────────────────────────────
571
  with gr.Accordion("πŸ“œ Activity Log", open=False):
 
627
  outputs=ALL_OUTPUTS,
628
  )
629
 
630
+ # ══════════════════════════════════════════════════════════════════════════════
631
+ # FIX 1 (continued): css= and theme= moved here from gr.Blocks() constructor.
632
  # ══════════════════════════════════════════════════════════════════════════════
633
  if __name__ == "__main__":
634
+ demo.launch(
635
+ show_api=False,
636
+ theme=gr.themes.Base(),
637
+ css=CSS,
638
+ )