MatverseHub commited on
Commit
d6096b9
·
verified ·
1 Parent(s): 996a1a8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -7
app.py CHANGED
@@ -5,16 +5,19 @@ A simple Gradio demo that exposes placeholder values for Ω (Omega), Ψ (Psi),
5
  Replace the `show_metrics` function with your own logic to fetch real metrics from your ledger or database.
6
  """
7
  import gradio as gr
 
 
8
 
9
  # Placeholder function to return sample metrics; replace with real data retrieval.
10
  def show_metrics():
11
- # In a real app, you would pull these values from your backend or ledger.
12
- return {
13
- "Omega (Ω)": 0.93,
14
- "Psi (Ψ)": 0.88,
15
- "Theta (Θ)": 0.91,
16
- "CVaR": 0.04,
17
- }
 
18
 
19
  with gr.Blocks(title="MatVerse WebX Dashboard") as demo:
20
  gr.Markdown("""# MatVerse WebX Dashboard
 
5
  Replace the `show_metrics` function with your own logic to fetch real metrics from your ledger or database.
6
  """
7
  import gradio as gr
8
+ import requests
9
+
10
 
11
  # Placeholder function to return sample metrics; replace with real data retrieval.
12
  def show_metrics():
13
+ url = "https://raw.githubusercontent.com/matverse-acoa/core/main/dashboard/metrics.json"
14
+ try:
15
+ resp = requests.get(url, timeout=10)
16
+ resp.raise_for_status()
17
+ return resp.json()
18
+ except Exception as e:
19
+ return {"error": str(e)}
20
+
21
 
22
  with gr.Blocks(title="MatVerse WebX Dashboard") as demo:
23
  gr.Markdown("""# MatVerse WebX Dashboard