Spaces:
Runtime error
Runtime error
reverse sort
Browse files- app.py +1 -1
- calculate_elo.py +5 -8
app.py
CHANGED
|
@@ -223,7 +223,7 @@ def dataset_to_markdown(dataset):
|
|
| 223 |
|
| 224 |
|
| 225 |
elo_scores = load_dataset("openaccess-ai-collective/chatbot-arena-elo-scores")
|
| 226 |
-
elo_scores = elo_scores["train"].sort("elo_score")
|
| 227 |
|
| 228 |
|
| 229 |
with gr.Blocks() as arena:
|
|
|
|
| 223 |
|
| 224 |
|
| 225 |
elo_scores = load_dataset("openaccess-ai-collective/chatbot-arena-elo-scores")
|
| 226 |
+
elo_scores = elo_scores["train"].sort("elo_score", reverse=True)
|
| 227 |
|
| 228 |
|
| 229 |
with gr.Blocks() as arena:
|
calculate_elo.py
CHANGED
|
@@ -177,8 +177,6 @@ def get_last_processed_timestamp():
|
|
| 177 |
ScanIndexForward=False,
|
| 178 |
Limit=1
|
| 179 |
)
|
| 180 |
-
print(response)
|
| 181 |
-
# exit(0)
|
| 182 |
|
| 183 |
# If there are no items in the table, return a default timestamp
|
| 184 |
if not response['Items']:
|
|
@@ -262,10 +260,7 @@ def _backfill_logs():
|
|
| 262 |
)
|
| 263 |
|
| 264 |
def main():
|
| 265 |
-
# _backfill_logs()
|
| 266 |
-
# _create_elo_logs_table()
|
| 267 |
last_processed_timestamp = get_last_processed_timestamp()
|
| 268 |
-
# last_processed_timestamp = '1970-01-01T00:00:00'
|
| 269 |
battles = get_unprocessed_battles(last_processed_timestamp)
|
| 270 |
|
| 271 |
elo_scores = {}
|
|
@@ -300,10 +295,12 @@ def main():
|
|
| 300 |
for i, j in enumerate(elo_scores):
|
| 301 |
j["elo_score"] = float(j["elo_score"])
|
| 302 |
elo_scores[i] = j
|
|
|
|
| 303 |
|
| 304 |
-
|
| 305 |
-
|
| 306 |
-
|
|
|
|
| 307 |
|
| 308 |
|
| 309 |
if __name__ == "__main__":
|
|
|
|
| 177 |
ScanIndexForward=False,
|
| 178 |
Limit=1
|
| 179 |
)
|
|
|
|
|
|
|
| 180 |
|
| 181 |
# If there are no items in the table, return a default timestamp
|
| 182 |
if not response['Items']:
|
|
|
|
| 260 |
)
|
| 261 |
|
| 262 |
def main():
|
|
|
|
|
|
|
| 263 |
last_processed_timestamp = get_last_processed_timestamp()
|
|
|
|
| 264 |
battles = get_unprocessed_battles(last_processed_timestamp)
|
| 265 |
|
| 266 |
elo_scores = {}
|
|
|
|
| 295 |
for i, j in enumerate(elo_scores):
|
| 296 |
j["elo_score"] = float(j["elo_score"])
|
| 297 |
elo_scores[i] = j
|
| 298 |
+
print(elo_scores)
|
| 299 |
|
| 300 |
+
if battles:
|
| 301 |
+
# Convert the data into a format suitable for Hugging Face Dataset
|
| 302 |
+
elo_dataset = Dataset.from_list(elo_scores)
|
| 303 |
+
elo_dataset.push_to_hub("openaccess-ai-collective/chatbot-arena-elo-scores", private=False)
|
| 304 |
|
| 305 |
|
| 306 |
if __name__ == "__main__":
|