Spaces:
Runtime error
Runtime error
update
Browse files
app.py
CHANGED
@@ -113,40 +113,6 @@ def update_leaderboard_dataset_parallel(rl_env, path):
|
|
113 |
|
114 |
return ranked_dataframe
|
115 |
|
116 |
-
|
117 |
-
def update_leaderboard_dataset(rl_env, path):
|
118 |
-
# Get model ids associated with rl_env
|
119 |
-
model_ids = get_model_ids(rl_env)
|
120 |
-
data = []
|
121 |
-
for model_id in model_ids:
|
122 |
-
"""
|
123 |
-
readme_path = hf_hub_download(model_id, filename="README.md")
|
124 |
-
meta = metadata_load(readme_path)
|
125 |
-
"""
|
126 |
-
meta = get_metadata(model_id)
|
127 |
-
#LOADED_MODEL_METADATA[model_id] = meta if meta is not None else ''
|
128 |
-
if meta is None:
|
129 |
-
continue
|
130 |
-
user_id = model_id.split('/')[0]
|
131 |
-
row = {}
|
132 |
-
row["User"] = user_id
|
133 |
-
row["Model"] = model_id
|
134 |
-
accuracy = parse_metrics_accuracy(meta)
|
135 |
-
mean_reward, std_reward = parse_rewards(accuracy)
|
136 |
-
mean_reward = mean_reward if not pd.isna(mean_reward) else 0
|
137 |
-
std_reward = std_reward if not pd.isna(std_reward) else 0
|
138 |
-
row["Results"] = mean_reward - std_reward
|
139 |
-
row["Mean Reward"] = mean_reward
|
140 |
-
row["Std Reward"] = std_reward
|
141 |
-
data.append(row)
|
142 |
-
|
143 |
-
ranked_dataframe = rank_dataframe(pd.DataFrame.from_records(data))
|
144 |
-
new_history = ranked_dataframe
|
145 |
-
file_path = path + "/" + rl_env + ".csv"
|
146 |
-
new_history.to_csv(file_path, index=False)
|
147 |
-
|
148 |
-
return ranked_dataframe
|
149 |
-
|
150 |
def download_leaderboard_dataset():
|
151 |
path = snapshot_download(repo_id=DATASET_REPO_ID, repo_type="dataset")
|
152 |
return path
|
@@ -194,7 +160,7 @@ def run_update_dataset():
|
|
194 |
|
195 |
api.upload_folder(
|
196 |
folder_path=path_,
|
197 |
-
repo_id="
|
198 |
repo_type="dataset",
|
199 |
commit_message="Update dataset")
|
200 |
|
|
|
113 |
|
114 |
return ranked_dataframe
|
115 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
116 |
def download_leaderboard_dataset():
|
117 |
path = snapshot_download(repo_id=DATASET_REPO_ID, repo_type="dataset")
|
118 |
return path
|
|
|
160 |
|
161 |
api.upload_folder(
|
162 |
folder_path=path_,
|
163 |
+
repo_id="huph22/drlc-leaderboard-data",
|
164 |
repo_type="dataset",
|
165 |
commit_message="Update dataset")
|
166 |
|