Spaces:
Sleeping
Sleeping
Kabalisticus
commited on
Commit
•
af3a32f
1
Parent(s):
0809f04
test 2
Browse files
app.py
CHANGED
@@ -4,7 +4,7 @@ import pandas as pd
|
|
4 |
import os
|
5 |
import time
|
6 |
import datetime
|
7 |
-
from utils import fetch_competition_summary, fetch_models_evaluation
|
8 |
|
9 |
st.set_page_config(layout="wide")
|
10 |
|
@@ -115,6 +115,10 @@ def main():
|
|
115 |
else:
|
116 |
competition_summaries, model_evaluations, _ = load_competition_data(st.session_state.last_update_time)
|
117 |
|
|
|
|
|
|
|
|
|
118 |
st.write(f"Last updated: {time.ctime(st.session_state.last_update_time)}")
|
119 |
|
120 |
st.markdown("### Competitions")
|
|
|
4 |
import os
|
5 |
import time
|
6 |
import datetime
|
7 |
+
from utils import fetch_competition_summary, fetch_models_evaluation, get_all_competition_summary
|
8 |
|
9 |
st.set_page_config(layout="wide")
|
10 |
|
|
|
115 |
else:
|
116 |
competition_summaries, model_evaluations, _ = load_competition_data(st.session_state.last_update_time)
|
117 |
|
118 |
+
competition_all_data = get_all_competition_summary(api, projects)
|
119 |
+
st.write(f"Competition {competition_all_data}")
|
120 |
+
#-----
|
121 |
+
|
122 |
st.write(f"Last updated: {time.ctime(st.session_state.last_update_time)}")
|
123 |
|
124 |
st.markdown("### Competitions")
|
utils.py
CHANGED
@@ -4,8 +4,24 @@ import wandb
|
|
4 |
import datetime
|
5 |
|
6 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7 |
def fetch_competition_summary(api, projects, selected_project):
|
8 |
data = []
|
|
|
9 |
st.write(f"Fetching competition summary for {selected_project}")
|
10 |
|
11 |
entity = projects[selected_project]["entity"]
|
|
|
4 |
import datetime
|
5 |
|
6 |
|
7 |
+
def get_all_competition_summary(api, projects):
|
8 |
+
data = {
|
9 |
+
"Number of competitions": 0,
|
10 |
+
"Number of model runs": 0,
|
11 |
+
"Last updated": datetime.now().strftime("%Y-%m-%d %H:%M:%S"),
|
12 |
+
}
|
13 |
+
for project in projects:
|
14 |
+
entity = projects[project]["entity"]
|
15 |
+
project_name = projects[project]["project"]
|
16 |
+
runs = api.runs(f"{entity}/{project_name}")
|
17 |
+
data["Number of competitions"] += 1
|
18 |
+
data["Number of model runs"] += len(runs)
|
19 |
+
|
20 |
+
return data
|
21 |
+
|
22 |
def fetch_competition_summary(api, projects, selected_project):
|
23 |
data = []
|
24 |
+
|
25 |
st.write(f"Fetching competition summary for {selected_project}")
|
26 |
|
27 |
entity = projects[selected_project]["entity"]
|