Upload app.py with huggingface_hub
Browse files
app.py
CHANGED
|
@@ -62,15 +62,19 @@ def format_step_viewer(consensus_result):
|
|
| 62 |
# (This assumes agent_responses were passed in or stored)
|
| 63 |
# For the UI, we'll just show the representative trace from valid agents
|
| 64 |
if not agent["is_hallucinating"] or score > 0.4:
|
|
|
|
| 65 |
html += f"""
|
| 66 |
<div class="glass-card reasoning-step {status_class}" style="{glow_style}">
|
| 67 |
<div style="display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px;">
|
| 68 |
<span class="monospace" style="color: #6366f1; font-weight: 600;">{agent['agent']} Reasoning Path</span>
|
| 69 |
<span style="font-size: 0.8em; background: rgba(0,0,0,0.3); padding: 2px 8px; border-radius: 4px;">Consensus: {score:.2f} {icon}</span>
|
| 70 |
</div>
|
| 71 |
-
<div style="font-size: 0.9em; line-height: 1.6; color: #cbd5e1;">
|
| 72 |
{"<br>".join([f"• {step}" for step in agent.get('reasoning_trace', ['Processing...'])])}
|
| 73 |
</div>
|
|
|
|
|
|
|
|
|
|
| 74 |
</div>
|
| 75 |
"""
|
| 76 |
html += "</div>"
|
|
|
|
| 62 |
# (This assumes agent_responses were passed in or stored)
|
| 63 |
# For the UI, we'll just show the representative trace from valid agents
|
| 64 |
if not agent["is_hallucinating"] or score > 0.4:
|
| 65 |
+
verification_msg = f"✅ Ast-Parsed Answer matches consensus group." if score >= 0.7 else f"❌ Answer diverged from consensus."
|
| 66 |
html += f"""
|
| 67 |
<div class="glass-card reasoning-step {status_class}" style="{glow_style}">
|
| 68 |
<div style="display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px;">
|
| 69 |
<span class="monospace" style="color: #6366f1; font-weight: 600;">{agent['agent']} Reasoning Path</span>
|
| 70 |
<span style="font-size: 0.8em; background: rgba(0,0,0,0.3); padding: 2px 8px; border-radius: 4px;">Consensus: {score:.2f} {icon}</span>
|
| 71 |
</div>
|
| 72 |
+
<div style="font-size: 0.9em; line-height: 1.6; color: #cbd5e1; margin-bottom: 8px;">
|
| 73 |
{"<br>".join([f"• {step}" for step in agent.get('reasoning_trace', ['Processing...'])])}
|
| 74 |
</div>
|
| 75 |
+
<div style="font-size: 0.85em; padding: 6px; background: rgba(0,0,0,0.2); border-left: 3px solid {'#10b981' if score >= 0.7 else '#ef4444'}; color: {'#34d399' if score >= 0.7 else '#f87171'};">
|
| 76 |
+
<strong>math_verify check:</strong> {verification_msg}
|
| 77 |
+
</div>
|
| 78 |
</div>
|
| 79 |
"""
|
| 80 |
html += "</div>"
|