Spaces:
Runtime error
Runtime error
add main metrics
Browse files- app.py +12 -4
- dashboard_utils/main_metrics.py +19 -0
app.py
CHANGED
|
@@ -1,20 +1,28 @@
|
|
|
|
|
| 1 |
import streamlit as st
|
| 2 |
import wandb
|
| 3 |
from streamlit_observable import observable
|
| 4 |
|
| 5 |
from dashboard_utils.bubbles import get_new_bubble_data
|
| 6 |
|
| 7 |
-
st.title("Training transformers together dashboard")
|
| 8 |
-
st.write("test")
|
| 9 |
wandb.login(anonymous="must")
|
| 10 |
|
| 11 |
-
|
|
|
|
| 12 |
|
|
|
|
| 13 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 14 |
observers = observable(
|
| 15 |
"Participants",
|
| 16 |
notebook="d/9ae236a507f54046", # "@huggingface/participants-bubbles-chart",
|
| 17 |
targets=["c_noaws"],
|
| 18 |
-
# observe=["selectedCounties"]
|
| 19 |
redefine={"serializedData": serialized_data, "profileSimple": profiles},
|
| 20 |
)
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from dashboard_utils.main_metrics import get_main_metrics
|
| 2 |
import streamlit as st
|
| 3 |
import wandb
|
| 4 |
from streamlit_observable import observable
|
| 5 |
|
| 6 |
from dashboard_utils.bubbles import get_new_bubble_data
|
| 7 |
|
|
|
|
|
|
|
| 8 |
wandb.login(anonymous="must")
|
| 9 |
|
| 10 |
+
st.title("Training transformers together dashboard")
|
| 11 |
+
st.header("Training Loss")
|
| 12 |
|
| 13 |
+
steps, losses, alive_peers = get_main_metrics()
|
| 14 |
|
| 15 |
+
st.line_chart(data={"steps": steps, "loss":losses})
|
| 16 |
+
|
| 17 |
+
st.header("Collaborative training participants")
|
| 18 |
+
st.header("Snapshot")
|
| 19 |
+
serialized_data, profiles = get_new_bubble_data()
|
| 20 |
observers = observable(
|
| 21 |
"Participants",
|
| 22 |
notebook="d/9ae236a507f54046", # "@huggingface/participants-bubbles-chart",
|
| 23 |
targets=["c_noaws"],
|
|
|
|
| 24 |
redefine={"serializedData": serialized_data, "profileSimple": profiles},
|
| 25 |
)
|
| 26 |
+
|
| 27 |
+
st.header("Overtime")
|
| 28 |
+
st.line_chart(data={"steps": steps, "alive participants":alive_peers})
|
dashboard_utils/main_metrics.py
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import wandb
|
| 2 |
+
|
| 3 |
+
WANDB_REPO = "learning-at-home/Main_metrics"
|
| 4 |
+
|
| 5 |
+
def get_main_metrics():
|
| 6 |
+
api = wandb.Api()
|
| 7 |
+
runs = api.runs(WANDB_REPO)
|
| 8 |
+
run = runs[0]
|
| 9 |
+
history = run.scan_history(keys=["step", "loss", "alive peers"])
|
| 10 |
+
|
| 11 |
+
steps = []
|
| 12 |
+
losses = []
|
| 13 |
+
alive_peers = []
|
| 14 |
+
for row in history:
|
| 15 |
+
steps.append(row["step"])
|
| 16 |
+
losses.append(row["loss"])
|
| 17 |
+
alive_peers.append(row["alive peers"])
|
| 18 |
+
|
| 19 |
+
return steps, losses, alive_peers
|