Spaces:
Sleeping
Sleeping
ping98k
commited on
Commit
·
c595827
1
Parent(s):
87cbfc7
Fix score averaging for numeric result
Browse files
main.py
CHANGED
|
@@ -61,9 +61,13 @@ def run_tournament(
|
|
| 61 |
|
| 62 |
if enable_score_filter:
|
| 63 |
def score(player):
|
| 64 |
-
data = _clean_json(
|
| 65 |
-
|
| 66 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 67 |
|
| 68 |
yield from log("Scoring players …")
|
| 69 |
with ThreadPoolExecutor(max_workers=max_workers) as ex:
|
|
|
|
| 61 |
|
| 62 |
if enable_score_filter:
|
| 63 |
def score(player):
|
| 64 |
+
data = _clean_json(
|
| 65 |
+
prompt_score(instruction, criteria_block(), player)
|
| 66 |
+
)
|
| 67 |
+
if "scores" in data and isinstance(data["scores"], list):
|
| 68 |
+
vals = data["scores"]
|
| 69 |
+
return sum(vals) / len(vals) if vals else 0.0
|
| 70 |
+
return float(data.get("score", 0))
|
| 71 |
|
| 72 |
yield from log("Scoring players …")
|
| 73 |
with ThreadPoolExecutor(max_workers=max_workers) as ex:
|