Spaces:
Runtime error
Runtime error
Test full process with datasets
Browse files- 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 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
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(
|
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():
|