Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -681,34 +681,34 @@ with gr.Blocks(title="Misinformation Detection & Public Engagement ") as demo:
|
|
| 681 |
</div>
|
| 682 |
""")
|
| 683 |
|
| 684 |
-
#
|
| 685 |
-
|
| 686 |
-
|
| 687 |
-
|
| 688 |
-
|
| 689 |
-
|
| 690 |
-
|
| 691 |
-
|
| 692 |
-
|
| 693 |
-
|
| 694 |
-
|
| 695 |
-
|
| 696 |
-
|
| 697 |
-
|
| 698 |
-
|
| 699 |
-
|
| 700 |
-
|
| 701 |
-
|
| 702 |
-
|
| 703 |
-
|
| 704 |
-
|
| 705 |
-
|
| 706 |
-
|
| 707 |
-
|
| 708 |
-
|
| 709 |
-
|
| 710 |
-
|
| 711 |
-
|
| 712 |
with gr.Tabs():
|
| 713 |
|
| 714 |
with gr.TabItem("π YouTube URL"):
|
|
|
|
| 681 |
</div>
|
| 682 |
""")
|
| 683 |
|
| 684 |
+
# Settings β NO API key field
|
| 685 |
+
with gr.Accordion("βοΈ Settings", open=False):
|
| 686 |
+
gr.HTML("""
|
| 687 |
+
<div style="background:#0d1119;border:1px solid #1e2330;border-radius:8px;
|
| 688 |
+
padding:0.7rem 1rem;margin-bottom:0.8rem;font-family:'DM Mono',monospace;
|
| 689 |
+
font-size:0.78rem;color:#5a6070">
|
| 690 |
+
π YouTube API key is read from the <code style="color:#00d4ff">YT_API_KEY</code>
|
| 691 |
+
Space secret β it is never exposed in the UI.
|
| 692 |
+
</div>
|
| 693 |
+
""")
|
| 694 |
+
with gr.Row():
|
| 695 |
+
sentiment_selector = gr.Dropdown(
|
| 696 |
+
choices=[
|
| 697 |
+
("VADER β fast, CPU-only (~5 000 comments/sec)", "vader"),
|
| 698 |
+
("DistilBERT β accurate, downloads ~500 MB on first run", "hf"),
|
| 699 |
+
],
|
| 700 |
+
value="vader",
|
| 701 |
+
label="Sentiment Engine",
|
| 702 |
+
scale=3,
|
| 703 |
+
)
|
| 704 |
+
max_comments_slider = gr.Slider(
|
| 705 |
+
minimum=10, maximum=500, value=150, step=10,
|
| 706 |
+
label="Max comments to fetch",
|
| 707 |
+
scale=3,
|
| 708 |
+
info="YouTube API quota: ~1 unit per comment request",
|
| 709 |
+
)
|
| 710 |
+
|
| 711 |
+
Input tabs
|
| 712 |
with gr.Tabs():
|
| 713 |
|
| 714 |
with gr.TabItem("π YouTube URL"):
|