Spaces:
Paused
Paused
fix wandb path
Browse files- app.py +4 -4
- opendashboards/assets/io.py +1 -2
- opendashboards/utils/utils.py +6 -6
app.py
CHANGED
|
@@ -9,7 +9,7 @@ from opendashboards.assets import io, inspect, metric, plot
|
|
| 9 |
# cache individual file loads
|
| 10 |
# Hotkey churn
|
| 11 |
|
| 12 |
-
|
| 13 |
DEFAULT_FILTERS = {"tags": {"$in": [f'1.1.{i}' for i in range(10)]}}
|
| 14 |
DEFAULT_SELECTED_HOTKEYS = None
|
| 15 |
DEFAULT_TASK = 'qa'
|
|
@@ -21,10 +21,10 @@ st.set_page_config(
|
|
| 21 |
page_title='Validator Dashboard',
|
| 22 |
menu_items={
|
| 23 |
'Report a bug': "https://github.com/opentensor/dashboards/issues",
|
| 24 |
-
'About': """
|
| 25 |
This dashboard is part of the OpenTensor project. \n
|
| 26 |
To see runs in wandb, go to: \n
|
| 27 |
-
https://wandb.ai/
|
| 28 |
"""
|
| 29 |
},
|
| 30 |
layout = "centered"
|
|
@@ -37,7 +37,7 @@ st.markdown('#')
|
|
| 37 |
|
| 38 |
|
| 39 |
with st.spinner(text=f'Checking wandb...'):
|
| 40 |
-
df_runs = io.load_runs(project=
|
| 41 |
|
| 42 |
metric.wandb(df_runs)
|
| 43 |
|
|
|
|
| 9 |
# cache individual file loads
|
| 10 |
# Hotkey churn
|
| 11 |
|
| 12 |
+
WANDB_PROJECT = "opentensor-dev/alpha-validators"
|
| 13 |
DEFAULT_FILTERS = {"tags": {"$in": [f'1.1.{i}' for i in range(10)]}}
|
| 14 |
DEFAULT_SELECTED_HOTKEYS = None
|
| 15 |
DEFAULT_TASK = 'qa'
|
|
|
|
| 21 |
page_title='Validator Dashboard',
|
| 22 |
menu_items={
|
| 23 |
'Report a bug': "https://github.com/opentensor/dashboards/issues",
|
| 24 |
+
'About': f"""
|
| 25 |
This dashboard is part of the OpenTensor project. \n
|
| 26 |
To see runs in wandb, go to: \n
|
| 27 |
+
https://wandb.ai/{WANDB_PROJECT}/table?workspace=default
|
| 28 |
"""
|
| 29 |
},
|
| 30 |
layout = "centered"
|
|
|
|
| 37 |
|
| 38 |
|
| 39 |
with st.spinner(text=f'Checking wandb...'):
|
| 40 |
+
df_runs = io.load_runs(project=WANDB_PROJECT, filters=DEFAULT_FILTERS, min_steps=10)
|
| 41 |
|
| 42 |
metric.wandb(df_runs)
|
| 43 |
|
opendashboards/assets/io.py
CHANGED
|
@@ -12,7 +12,6 @@ from pandas.api.types import (
|
|
| 12 |
is_object_dtype,
|
| 13 |
)
|
| 14 |
|
| 15 |
-
|
| 16 |
@st.cache_data
|
| 17 |
def load_runs(project, filters, min_steps=10):
|
| 18 |
runs = []
|
|
@@ -21,7 +20,7 @@ def load_runs(project, filters, min_steps=10):
|
|
| 21 |
progress = st.progress(0, 'Fetching runs from wandb')
|
| 22 |
msg = st.empty()
|
| 23 |
|
| 24 |
-
all_runs = utils.get_runs(project, filters
|
| 25 |
for i, run in enumerate(all_runs):
|
| 26 |
|
| 27 |
summary = run.summary
|
|
|
|
| 12 |
is_object_dtype,
|
| 13 |
)
|
| 14 |
|
|
|
|
| 15 |
@st.cache_data
|
| 16 |
def load_runs(project, filters, min_steps=10):
|
| 17 |
runs = []
|
|
|
|
| 20 |
progress = st.progress(0, 'Fetching runs from wandb')
|
| 21 |
msg = st.empty()
|
| 22 |
|
| 23 |
+
all_runs = utils.get_runs(project, filters)
|
| 24 |
for i, run in enumerate(all_runs):
|
| 25 |
|
| 26 |
summary = run.summary
|
opendashboards/utils/utils.py
CHANGED
|
@@ -20,14 +20,16 @@ import re
|
|
| 20 |
import tqdm
|
| 21 |
import wandb
|
| 22 |
import pandas as pd
|
| 23 |
-
|
| 24 |
from traceback import format_exc
|
| 25 |
from pandas.api.types import is_list_like
|
| 26 |
|
| 27 |
from typing import List, Dict, Any, Union
|
| 28 |
|
|
|
|
|
|
|
| 29 |
|
| 30 |
-
def pull_wandb_runs(project
|
| 31 |
all_runs = get_runs(project, filters)
|
| 32 |
print(f'Using {ntop}/{len(all_runs)} runs with more than {min_steps} events')
|
| 33 |
pbar = tqdm.tqdm(all_runs)
|
|
@@ -82,19 +84,17 @@ def pull_wandb_runs(project='openvalidators', filters=None, min_steps=50, ntop=1
|
|
| 82 |
|
| 83 |
|
| 84 |
|
| 85 |
-
def get_runs(project: str
|
| 86 |
"""Download runs from wandb.
|
| 87 |
|
| 88 |
Args:
|
| 89 |
-
project (str): Name of the project.
|
| 90 |
filters (Dict[str, Any], optional): Optional run filters for wandb api. Defaults to None.
|
| 91 |
return_paths (bool, optional): Return only run paths. Defaults to False.
|
| 92 |
|
| 93 |
Returns:
|
| 94 |
List[wandb.apis.public.Run]: List of runs or run paths (List[str]).
|
| 95 |
"""
|
| 96 |
-
api = wandb.Api(api_key=api_key)
|
| 97 |
-
wandb.login(anonymous="allow")
|
| 98 |
|
| 99 |
runs = api.runs(project, filters=filters)
|
| 100 |
if return_paths:
|
|
|
|
| 20 |
import tqdm
|
| 21 |
import wandb
|
| 22 |
import pandas as pd
|
| 23 |
+
import streamlit as st
|
| 24 |
from traceback import format_exc
|
| 25 |
from pandas.api.types import is_list_like
|
| 26 |
|
| 27 |
from typing import List, Dict, Any, Union
|
| 28 |
|
| 29 |
+
api = wandb.Api(api_key=st.secrets['WANDB_API_KEY'])
|
| 30 |
+
wandb.login(anonymous="allow")
|
| 31 |
|
| 32 |
+
def pull_wandb_runs(project: str, filters=None, min_steps=50, ntop=10, summary_filters=None ):
|
| 33 |
all_runs = get_runs(project, filters)
|
| 34 |
print(f'Using {ntop}/{len(all_runs)} runs with more than {min_steps} events')
|
| 35 |
pbar = tqdm.tqdm(all_runs)
|
|
|
|
| 84 |
|
| 85 |
|
| 86 |
|
| 87 |
+
def get_runs(project: str, filters: Dict[str, Any] = None, return_paths: bool = False) -> List:
|
| 88 |
"""Download runs from wandb.
|
| 89 |
|
| 90 |
Args:
|
| 91 |
+
project (str): Name of the project.
|
| 92 |
filters (Dict[str, Any], optional): Optional run filters for wandb api. Defaults to None.
|
| 93 |
return_paths (bool, optional): Return only run paths. Defaults to False.
|
| 94 |
|
| 95 |
Returns:
|
| 96 |
List[wandb.apis.public.Run]: List of runs or run paths (List[str]).
|
| 97 |
"""
|
|
|
|
|
|
|
| 98 |
|
| 99 |
runs = api.runs(project, filters=filters)
|
| 100 |
if return_paths:
|