ajaykumar0712 commited on
Commit
5c48228
·
verified ·
1 Parent(s): 00d258b

Update src/streamlit_app.py

Browse files
Files changed (1) hide show
  1. src/streamlit_app.py +7 -4
src/streamlit_app.py CHANGED
@@ -60,6 +60,7 @@ with left:
60
  # teamB = words[2]
61
 
62
  intent_data = detect_intent(query)
 
63
 
64
  intent = intent_data.get("intent")
65
  teamA = intent_data.get("teamA")
@@ -77,9 +78,11 @@ with left:
77
  try:
78
  if intent == "match_prediction":
79
  if not teamA or not teamB:
80
- st.error("Please provide two teams")
81
- break
 
82
  agent_outputs = run_agents("match", teamA, teamB)
 
83
  probs = elo_probability(teamA, teamB)
84
  probA = probs["probA"]
85
  probB = probs["probB"]
@@ -228,8 +231,8 @@ with right:
228
 
229
  st.subheader("Batting Comparison")
230
 
231
- teamA_bat = team_map.get(teamA.upper(), teamA.upper())
232
- teamB_bat = team_map.get(teamB.upper(), teamB.upper())
233
 
234
  team_batters = batters[
235
  batters["team"].str.upper().isin([teamA_bat.upper(), teamB_bat.upper()])
 
60
  # teamB = words[2]
61
 
62
  intent_data = detect_intent(query)
63
+ st.write("DEBUG:", intent_data)
64
 
65
  intent = intent_data.get("intent")
66
  teamA = intent_data.get("teamA")
 
78
  try:
79
  if intent == "match_prediction":
80
  if not teamA or not teamB:
81
+ st.error("❌ Could not detect both teams. Try: India vs Australia")
82
+ st.stop()
83
+
84
  agent_outputs = run_agents("match", teamA, teamB)
85
+
86
  probs = elo_probability(teamA, teamB)
87
  probA = probs["probA"]
88
  probB = probs["probB"]
 
231
 
232
  st.subheader("Batting Comparison")
233
 
234
+ teamA_bat = team_map.get(teamA.upper(), teamA.upper()) if teamA else None
235
+ teamB_bat = team_map.get(teamB.upper(), teamB.upper()) if teamB else None
236
 
237
  team_batters = batters[
238
  batters["team"].str.upper().isin([teamA_bat.upper(), teamB_bat.upper()])