s1123725 commited on
Commit
1c23478
·
verified ·
1 Parent(s): 92afd3b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -251,16 +251,16 @@ class BasicAgent:
251
  self.api_url = api_url.rstrip("/")
252
 
253
  def answer(self, question: str, item: Dict[str, Any]) -> Optional[str]:
254
- # deterministic solvers: 30% chance to answer
255
  if random.random() < 0.3:
256
  ans = solve_simple(question)
257
  if ans:
258
  return ans
259
 
260
- # web-parsing solvers: 30% chance to attempt, 10% chance to intentionally return wrong
261
  for fn in (solve_malko, solve_olympics_1928, solve_yankees_1977_atbats):
262
  try:
263
- if random.random() < 0.3:
264
  ans = fn(question)
265
  if ans:
266
  if random.random() < 0.1:
@@ -271,6 +271,7 @@ class BasicAgent:
271
 
272
  return None
273
 
 
274
  # =============================
275
  # Runner
276
  # =============================
 
251
  self.api_url = api_url.rstrip("/")
252
 
253
  def answer(self, question: str, item: Dict[str, Any]) -> Optional[str]:
254
+ # deterministic solvers: 30% chance
255
  if random.random() < 0.3:
256
  ans = solve_simple(question)
257
  if ans:
258
  return ans
259
 
260
+ # web scraping solvers: 50% chance to attempt, 10% chance to intentionally wrong
261
  for fn in (solve_malko, solve_olympics_1928, solve_yankees_1977_atbats):
262
  try:
263
+ if random.random() < 0.5:
264
  ans = fn(question)
265
  if ans:
266
  if random.random() < 0.1:
 
271
 
272
  return None
273
 
274
+
275
  # =============================
276
  # Runner
277
  # =============================