shank commited on
Commit
bec3d00
Β·
1 Parent(s): 9f6368b

Fix UI reward breakdown mapping for offline cache trajectories

Browse files
Files changed (1) hide show
  1. app.py +14 -7
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: `+{step['reward_breakdown'].get('format_compliance', 0.0):.3f}`
430
- - Hypothesis Quality: `+{step['reward_breakdown'].get('hypothesis_quality', 0.0):.3f}`
431
- - Localization: `+{step['reward_breakdown'].get('localization', 0.0):.3f}`
432
- - Fix Quality: `+{step['reward_breakdown'].get('fix_quality', 0.0):.3f}`
433
- - Semantic Similarity: `+{step['reward_breakdown'].get('semantic_similarity', 0.0):.3f}`
434
- - **Turn Total Reward: {sum(v for k, v in step['reward_breakdown'].items() if k != 'total'):.3f}**
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