sammy786 commited on
Commit
0025aaa
Β·
verified Β·
1 Parent(s): 6087316

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +27 -27
app.py CHANGED
@@ -2606,33 +2606,33 @@ with gr.Blocks(
2606
 
2607
  output += f"""
2608
 
2609
- ---
2610
-
2611
- ### πŸ’‘ Key Insights
2612
-
2613
- - **Biggest Single Opportunity:** ${max(results, key=lambda x: x['missed_savings'])['missed_savings']:.2f} at {max(results, key=lambda x: x['missed_savings'])['merchant']}
2614
- - **Most Common Category:** {max(set([r['category'] for r in results]), key=[r['category'] for r in results].count)}
2615
- - **Average Transaction:** ${total_spending / len(results):.2f}
2616
- - **Optimization Potential:** {((total_optimal_rewards - total_rewards_earned) / total_rewards_earned * 100):.1f}% more rewards possible
2617
-
2618
- ---
2619
-
2620
- <div style="background: linear-gradient(135deg, #fff3cd 0%, #fff8e1 100%); padding: 20px; border-radius: 12px; border-left: 4px solid #ffc107; margin: 20px 0;">
2621
- <h4 style="margin: 0 0 10px 0; color: #856404;">πŸ’‘ What This Means</h4>
2622
- <p style="margin: 0; color: #5d4037; font-size: 15px;">
2623
- If you had used our AI recommendations for these {len(results)} transactions, you would have earned
2624
- <strong style="color: #e65100;">${total_missed:.2f} more</strong> in rewards.
2625
- Over a full year, that's <strong style="color: #e65100;">${total_missed * (365 / days):.0f}+</strong> in extra rewards!
2626
- </p>
2627
- </div>
2628
-
2629
- ---
2630
-
2631
- <div style="background: #e8f5e9; padding: 20px; border-radius: 10px; border-left: 4px solid #4caf50;">
2632
- <strong>πŸš€ Powered by Modal:</strong> This analysis processed {len(results)} transactions in parallel using serverless compute.
2633
- In production, Modal can handle 1000+ transactions in seconds with automatic scaling.
2634
- </div>
2635
- """
2636
 
2637
  # Create charts
2638
  import plotly.graph_objects as go
 
2606
 
2607
  output += f"""
2608
 
2609
+ ---
2610
+
2611
+ ### πŸ’‘ Key Insights
2612
+
2613
+ - **Biggest Single Opportunity:** ${biggest_opp:.2f} at {merchant}
2614
+ - **Most Common Category:** {category}
2615
+ - **Average Transaction:** ${avg_trans:.2f}
2616
+ - **Optimization Potential:** {potential:.1f}% more rewards possible
2617
+
2618
+ ---
2619
+
2620
+ <div style="background: linear-gradient(135deg, #fff3cd 0%, #fff8e1 100%); padding: 20px; border-radius: 12px; border-left: 4px solid #ffc107; margin: 20px 0;">
2621
+ <h4 style="margin: 0 0 10px 0; color: #856404;">πŸ’‘ What This Means</h4>
2622
+ <p style="margin: 0; color: #5d4037; font-size: 15px;">
2623
+ If you had used our AI recommendations for these {count} transactions, you would have earned
2624
+ <strong style="color: #e65100;">${extra:.2f} more</strong> in rewards.
2625
+ Over a full year, that's <strong style="color: #e65100;">${yearly:.0f}+</strong> in extra rewards!
2626
+ </p>
2627
+ </div>
2628
+
2629
+ ---
2630
+
2631
+ <div style="background: #e8f5e9; padding: 20px; border-radius: 10px; border-left: 4px solid #4caf50;">
2632
+ <strong>πŸš€ Powered by Modal:</strong> This analysis processed {count} transactions in parallel using serverless compute.
2633
+ In production, Modal can handle 1000+ transactions in seconds with automatic scaling.
2634
+ </div>
2635
+ """
2636
 
2637
  # Create charts
2638
  import plotly.graph_objects as go