Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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(
|
| 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 |
-
|
| 549 |
-
|
| 550 |
-
|
| 551 |
-
|
| 552 |
-
|
|
|
|
| 553 |
with gr.TabItem("Positive"):
|
| 554 |
-
|
|
|
|
| 555 |
with gr.TabItem("Negative"):
|
| 556 |
-
|
|
|
|
| 557 |
with gr.TabItem("Most Liked"):
|
| 558 |
-
|
|
|
|
| 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(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 |
+
)
|