GuglielmoTor commited on
Commit
bff5b73
·
verified ·
1 Parent(s): 25ab3ad

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -4
app.py CHANGED
@@ -63,10 +63,12 @@ def guarded_fetch_analytics():
63
  )
64
  return count_md, plot
65
 
66
- def run_mentions_and_load(comm_token_json, comm_client_id):
67
  try:
68
- comm_token_dict = json.loads(comm_token_json) # Fix here
69
- html_path = generate_mentions_dashboard(comm_client_id, comm_token_dict)
 
 
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=[token_display, client_display],
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