ThomasSimonini HF staff commited on
Commit
b21f2ca
1 Parent(s): 0496749

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -5
app.py CHANGED
@@ -181,7 +181,7 @@ def get_model_ids(rl_env):
181
  model_ids = [x.modelId for x in models]
182
  return model_ids
183
 
184
- def update_leaderboard_dataset(rl_env):
185
  # Get model ids associated with rl_env
186
  model_ids = get_model_ids(rl_env)
187
  data = []
@@ -209,9 +209,8 @@ def update_leaderboard_dataset(rl_env):
209
 
210
  ranked_dataframe = rank_dataframe(pd.DataFrame.from_records(data))
211
  new_history = ranked_dataframe
212
- filename = rl_env + ".csv"
213
- new_history.to_csv(filename, index=False)
214
- csv_path = os.path.abspath(filename)
215
 
216
  return ranked_dataframe
217
 
@@ -258,7 +257,7 @@ def run_update_dataset():
258
  path_ = download_leaderboard_dataset()
259
  for i in range(0, len(rl_envs)):
260
  rl_env = rl_envs[i]
261
- update_leaderboard_dataset(rl_env["rl_env"])
262
 
263
  api.upload_folder(
264
  folder_path=path_,
 
181
  model_ids = [x.modelId for x in models]
182
  return model_ids
183
 
184
+ def update_leaderboard_dataset(rl_env, path):
185
  # Get model ids associated with rl_env
186
  model_ids = get_model_ids(rl_env)
187
  data = []
 
209
 
210
  ranked_dataframe = rank_dataframe(pd.DataFrame.from_records(data))
211
  new_history = ranked_dataframe
212
+ file_path = path + "/" + rl_env + ".csv"
213
+ new_history.to_csv(file_path, index=False)
 
214
 
215
  return ranked_dataframe
216
 
 
257
  path_ = download_leaderboard_dataset()
258
  for i in range(0, len(rl_envs)):
259
  rl_env = rl_envs[i]
260
+ update_leaderboard_dataset(rl_env["rl_env"], path_)
261
 
262
  api.upload_folder(
263
  folder_path=path_,