Spaces:
Sleeping
Sleeping
Merge branch 'codex/add-total-token-count-and-log-completion-output' of https://github.com/ping98k/llm-brainstorm into codex/add-total-token-count-and-log-completion-output
Browse files
main.py
CHANGED
|
@@ -132,7 +132,7 @@ def run_tournament(
|
|
| 132 |
p: s
|
| 133 |
for p, s in zip(
|
| 134 |
all_players,
|
| 135 |
-
ex.map(score, all_players),
|
| 136 |
)
|
| 137 |
}
|
| 138 |
hist_fig = plt.figure()
|
|
@@ -161,7 +161,7 @@ def run_tournament(
|
|
| 161 |
def tournament_round(pairs, executor):
|
| 162 |
futures = {executor.submit(play, a, b): (a, b) for a, b in pairs}
|
| 163 |
results = []
|
| 164 |
-
for fut in as_completed(futures):
|
| 165 |
a, b = futures[fut]
|
| 166 |
winner = fut.result()
|
| 167 |
loser = b if winner == a else a
|
|
@@ -192,7 +192,7 @@ def run_tournament(
|
|
| 192 |
for j in range(i + 1, len(candidates))
|
| 193 |
]
|
| 194 |
futures = {executor.submit(play, a, b): (a, b) for a, b in pairs}
|
| 195 |
-
for fut in as_completed(futures):
|
| 196 |
wins[fut.result()] += 1
|
| 197 |
return sorted(candidates, key=lambda p: wins[p], reverse=True)
|
| 198 |
|
|
|
|
| 132 |
p: s
|
| 133 |
for p, s in zip(
|
| 134 |
all_players,
|
| 135 |
+
tqdm(ex.map(score, all_players), total=len(all_players)),
|
| 136 |
)
|
| 137 |
}
|
| 138 |
hist_fig = plt.figure()
|
|
|
|
| 161 |
def tournament_round(pairs, executor):
|
| 162 |
futures = {executor.submit(play, a, b): (a, b) for a, b in pairs}
|
| 163 |
results = []
|
| 164 |
+
for fut in tqdm(as_completed(futures), total=len(futures)):
|
| 165 |
a, b = futures[fut]
|
| 166 |
winner = fut.result()
|
| 167 |
loser = b if winner == a else a
|
|
|
|
| 192 |
for j in range(i + 1, len(candidates))
|
| 193 |
]
|
| 194 |
futures = {executor.submit(play, a, b): (a, b) for a, b in pairs}
|
| 195 |
+
for fut in tqdm(as_completed(futures), total=len(futures)):
|
| 196 |
wins[fut.result()] += 1
|
| 197 |
return sorted(candidates, key=lambda p: wins[p], reverse=True)
|
| 198 |
|