TheXeos commited on
Commit
f3fe60b
1 Parent(s): 248df8c

Test full process with datasets

Browse files
Files changed (1) hide show
  1. background_task.py +5 -13
background_task.py CHANGED
@@ -108,19 +108,11 @@ class Matchmaking:
108
  data_dict["model"].append(model.name)
109
  data_dict["elo"].append(model.elo)
110
  data_dict["games_played"].append(model.games_played)
111
-
112
  df = pd.DataFrame(data_dict)
113
- fileobj = open('env_elos/elo.csv', 'w')
114
- df.to_csv(fileobj, index=False)
115
- api.upload_file(
116
- fileobj,
117
- "env_elos/elo.csv",
118
- "CarlCochet/BotFights",
119
- "Update elos",
120
- )
121
- df_matches = pd.DataFrame(self.matches)
122
- date = datetime.now()
123
- df_matches.to_csv(f"match_history/{date.strftime('%Y-%m-%d_%H-%M-%S_%f')}.csv", index=False)
124
 
125
 
126
  def match(model1, model2) -> float:
@@ -148,7 +140,7 @@ def get_models_list() -> list:
148
  """
149
  models = []
150
  models_names = []
151
- data = pd.read_csv("env_elos/elo.csv")
152
  # models_on_hub = api.list_models(filter=["reinforcement-learning", env, "stable-baselines3"])
153
  models_on_hub = []
154
  for i, row in data.iterrows():
 
108
  data_dict["model"].append(model.name)
109
  data_dict["elo"].append(model.elo)
110
  data_dict["games_played"].append(model.games_played)
 
111
  df = pd.DataFrame(data_dict)
112
+ df.to_csv(os.path.join(DATASET_REPO_URL, "resolve", "main", ELO_FILE))
113
+ # df_matches = pd.DataFrame(self.matches)
114
+ # date = datetime.now()
115
+ # df_matches.to_csv(f"match_history/{date.strftime('%Y-%m-%d_%H-%M-%S_%f')}.csv", index=False)
 
 
 
 
 
 
 
116
 
117
 
118
  def match(model1, model2) -> float:
 
140
  """
141
  models = []
142
  models_names = []
143
+ data = pd.read_csv(os.path.join(DATASET_REPO_URL, "resolve", "main", ELO_FILE))
144
  # models_on_hub = api.list_models(filter=["reinforcement-learning", env, "stable-baselines3"])
145
  models_on_hub = []
146
  for i, row in data.iterrows():