Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 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
|