Spaces:
Sleeping
Sleeping
Clamp scores to strictly (0,1) for validator
Browse files- server/rubrics.py +6 -0
server/rubrics.py
CHANGED
|
@@ -231,6 +231,12 @@ class ReleaseOpsRubric:
|
|
| 231 |
|
| 232 |
raw = sum(r.score * r.weight for r in results)
|
| 233 |
final_score = max(0.0, min(1.0, raw - forbidden_penalty))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 234 |
|
| 235 |
return {
|
| 236 |
"score": round(final_score, 3),
|
|
|
|
| 231 |
|
| 232 |
raw = sum(r.score * r.weight for r in results)
|
| 233 |
final_score = max(0.0, min(1.0, raw - forbidden_penalty))
|
| 234 |
+
|
| 235 |
+
# Clamp to strictly within (0, 1) — validator requires 0 < score < 1
|
| 236 |
+
if final_score <= 0.0:
|
| 237 |
+
final_score = 0.001
|
| 238 |
+
elif final_score >= 1.0:
|
| 239 |
+
final_score = 0.999
|
| 240 |
|
| 241 |
return {
|
| 242 |
"score": round(final_score, 3),
|