edbeeching commited on
Commit
a7919f0
1 Parent(s): aa7a039

fixed a bug when loading results

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -82,12 +82,11 @@ def get_leaderboard():
82
  if repo:
83
  print("pulling changes")
84
  repo.git_pull()
85
- entries = [entry for entry in os.listdir("evals") if not (entry.startswith('.') or entry=="eval_requests")]
86
  model_directories = [entry for entry in entries if os.path.isdir(os.path.join("evals", entry))]
87
  all_data = []
88
  for model in model_directories:
89
- model_data = {"base_model": None}
90
- model_data = {"eval_name": model}
91
 
92
  for benchmark, metric in zip(BENCHMARKS, METRICS):
93
  value, base_model = load_results(model, benchmark, metric)
@@ -102,7 +101,8 @@ def get_leaderboard():
102
 
103
  model_data["# params"] = get_n_params(model_data["base_model"])
104
 
105
- all_data.append(model_data)
 
106
 
107
  dataframe = pd.DataFrame.from_records(all_data)
108
  dataframe = dataframe.sort_values(by=['total ⬆️'], ascending=False)
 
82
  if repo:
83
  print("pulling changes")
84
  repo.git_pull()
85
+ entries = [entry for entry in os.listdir("evals") if not (entry.startswith('.') or entry=="eval_requests" or entry=="evals")]
86
  model_directories = [entry for entry in entries if os.path.isdir(os.path.join("evals", entry))]
87
  all_data = []
88
  for model in model_directories:
89
+ model_data = {"base_model": None, "eval_name": model}
 
90
 
91
  for benchmark, metric in zip(BENCHMARKS, METRICS):
92
  value, base_model = load_results(model, benchmark, metric)
 
101
 
102
  model_data["# params"] = get_n_params(model_data["base_model"])
103
 
104
+ if model_data["base_model"] is not None:
105
+ all_data.append(model_data)
106
 
107
  dataframe = pd.DataFrame.from_records(all_data)
108
  dataframe = dataframe.sort_values(by=['total ⬆️'], ascending=False)