Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -63,10 +63,12 @@ def guarded_fetch_analytics():
|
|
| 63 |
)
|
| 64 |
return count_md, plot
|
| 65 |
|
| 66 |
-
def run_mentions_and_load(
|
| 67 |
try:
|
| 68 |
-
|
| 69 |
-
|
|
|
|
|
|
|
| 70 |
with open(html_path, "r", encoding="utf-8") as f:
|
| 71 |
return f.read()
|
| 72 |
except Exception as e:
|
|
@@ -132,7 +134,7 @@ with gr.Blocks(theme=gr.themes.Soft(primary_hue="blue", secondary_hue="sky"),
|
|
| 132 |
mentions_html = gr.HTML(value="<p style='text-align:center; color:#555;'>Waiting for token...</p>")
|
| 133 |
fetch_mentions_btn.click(
|
| 134 |
fn=run_mentions_and_load,
|
| 135 |
-
inputs=[
|
| 136 |
outputs=[mentions_html]
|
| 137 |
)
|
| 138 |
|
|
|
|
| 63 |
)
|
| 64 |
return count_md, plot
|
| 65 |
|
| 66 |
+
def run_mentions_and_load():
|
| 67 |
try:
|
| 68 |
+
html_path = generate_mentions_dashboard(
|
| 69 |
+
token_received["client_id"],
|
| 70 |
+
token_received["token"]
|
| 71 |
+
)
|
| 72 |
with open(html_path, "r", encoding="utf-8") as f:
|
| 73 |
return f.read()
|
| 74 |
except Exception as e:
|
|
|
|
| 134 |
mentions_html = gr.HTML(value="<p style='text-align:center; color:#555;'>Waiting for token...</p>")
|
| 135 |
fetch_mentions_btn.click(
|
| 136 |
fn=run_mentions_and_load,
|
| 137 |
+
inputs=[],
|
| 138 |
outputs=[mentions_html]
|
| 139 |
)
|
| 140 |
|