Spaces:
Sleeping
Sleeping
Upload folder using huggingface_hub
Browse files- models.py +1 -1
- server/rewards.py +4 -2
models.py
CHANGED
|
@@ -109,4 +109,4 @@ class ValidatorState(State):
|
|
| 109 |
correct_reports: int = 0
|
| 110 |
false_positives: int = 0
|
| 111 |
duplicate_reports: int = 0
|
| 112 |
-
score: float = 0.
|
|
|
|
| 109 |
correct_reports: int = 0
|
| 110 |
false_positives: int = 0
|
| 111 |
duplicate_reports: int = 0
|
| 112 |
+
score: float = 0.01
|
server/rewards.py
CHANGED
|
@@ -92,7 +92,8 @@ def compute_step_reward(
|
|
| 92 |
completeness = correct_so_far / max(total_violations, 1)
|
| 93 |
bonus = DONE_BONUS_MULTIPLIER * completeness
|
| 94 |
# Clamp to strictly (0, 1) — evaluator requires score never equals 0.0 or 1.0
|
| 95 |
-
|
|
|
|
| 96 |
return RewardBreakdown(
|
| 97 |
reward=bonus,
|
| 98 |
is_correct=False,
|
|
@@ -169,4 +170,5 @@ def compute_episode_score(correct_count: int, total_violations: int) -> float:
|
|
| 169 |
if total_violations == 0:
|
| 170 |
return 0.5
|
| 171 |
raw = correct_count / total_violations
|
| 172 |
-
|
|
|
|
|
|
| 92 |
completeness = correct_so_far / max(total_violations, 1)
|
| 93 |
bonus = DONE_BONUS_MULTIPLIER * completeness
|
| 94 |
# Clamp to strictly (0, 1) — evaluator requires score never equals 0.0 or 1.0
|
| 95 |
+
# Use 0.01/0.99 so value is still non-zero/non-one after :.2f formatting
|
| 96 |
+
bonus = round(max(0.01, min(0.99, bonus)), 4)
|
| 97 |
return RewardBreakdown(
|
| 98 |
reward=bonus,
|
| 99 |
is_correct=False,
|
|
|
|
| 170 |
if total_violations == 0:
|
| 171 |
return 0.5
|
| 172 |
raw = correct_count / total_violations
|
| 173 |
+
# Use 0.01/0.99 so value is still non-zero/non-one after :.2f formatting
|
| 174 |
+
return round(max(0.01, min(0.99, raw)), 4)
|