shank commited on
Commit Β·
bec3d00
1
Parent(s): 9f6368b
Fix UI reward breakdown mapping for offline cache trajectories
Browse files
app.py
CHANGED
|
@@ -405,6 +405,13 @@ def get_bug_details(selected_name, eval_data):
|
|
| 405 |
# Color-coded action badge
|
| 406 |
action_color = "#8b5cf6" if step["action"] == "propose_fix" else "#3b82f6"
|
| 407 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 408 |
markdown_out.append(f"""
|
| 409 |
### π TURN {step['turn']}
|
| 410 |
---
|
|
@@ -426,13 +433,13 @@ def get_bug_details(selected_name, eval_data):
|
|
| 426 |
* `Outcome`: **{"β
SOLVED" if passed == total else "β STILL FAILING"}**
|
| 427 |
|
| 428 |
**Dense Reward Breakdown:**
|
| 429 |
-
- Format Compliance: `+{
|
| 430 |
-
- Hypothesis Quality: `+{
|
| 431 |
-
- Localization: `+{
|
| 432 |
-
- Fix Quality: `+{
|
| 433 |
-
- Semantic Similarity: `+{
|
| 434 |
-
- **Turn Total Reward: {sum(v for k, v in
|
| 435 |
-
|
| 436 |
|
| 437 |
return buggy_code, initial_error, "\n\n".join(markdown_out)
|
| 438 |
|
|
|
|
| 405 |
# Color-coded action badge
|
| 406 |
action_color = "#8b5cf6" if step["action"] == "propose_fix" else "#3b82f6"
|
| 407 |
|
| 408 |
+
rb = step["reward_breakdown"]
|
| 409 |
+
format_val = rb.get("format_compliance", rb.get("format_match", 0.0))
|
| 410 |
+
hypothesis_val = rb.get("hypothesis_quality", 0.0)
|
| 411 |
+
localization_val = rb.get("localization", rb.get("syntax_correctness", 0.0))
|
| 412 |
+
fix_val = rb.get("fix_quality", rb.get("functionality_reward", 0.0))
|
| 413 |
+
semantic_val = rb.get("semantic_similarity", 0.0)
|
| 414 |
+
|
| 415 |
markdown_out.append(f"""
|
| 416 |
### π TURN {step['turn']}
|
| 417 |
---
|
|
|
|
| 433 |
* `Outcome`: **{"β
SOLVED" if passed == total else "β STILL FAILING"}**
|
| 434 |
|
| 435 |
**Dense Reward Breakdown:**
|
| 436 |
+
- Format Compliance: `+{format_val:.3f}`
|
| 437 |
+
- Hypothesis Quality: `+{hypothesis_val:.3f}`
|
| 438 |
+
- Localization: `+{localization_val:.3f}`
|
| 439 |
+
- Fix Quality: `+{fix_val:.3f}`
|
| 440 |
+
- Semantic Similarity: `+{semantic_val:.3f}`
|
| 441 |
+
- **Turn Total Reward: {sum(v for k, v in rb.items() if k != 'total'):.3f}**
|
| 442 |
+
""")
|
| 443 |
|
| 444 |
return buggy_code, initial_error, "\n\n".join(markdown_out)
|
| 445 |
|