fried-nlp commited on
Commit
1b4093a
1 Parent(s): f49875f

Fix escaping

Browse files
Files changed (1) hide show
  1. handler.py +2 -2
handler.py CHANGED
@@ -38,10 +38,10 @@ class EndpointHandler:
38
  if len(sorted_programs) > 0:
39
  top_guess = sorted_programs[0][1]
40
  top_score = sorted_programs[0][0]
41
- top_success = parse(top_guess).equivalent(parse(true_program))
42
  top_10_guesses = [p for s, p in sorted_programs[:10]]
43
  top_10_scores = [s for s, p in sorted_programs[:10]]
44
- top_10_success = any([parse(p).equivalent(parse(true_program)) for p in top_10_guesses])
45
 
46
  return {
47
  "guess": top_guess,
 
38
  if len(sorted_programs) > 0:
39
  top_guess = sorted_programs[0][1]
40
  top_score = sorted_programs[0][0]
41
+ top_success = parse(top_guess.replace('\\', '')).equivalent(parse(true_program).replace('\\', ''))
42
  top_10_guesses = [p for s, p in sorted_programs[:10]]
43
  top_10_scores = [s for s, p in sorted_programs[:10]]
44
+ top_10_success = any([parse(p.replace('\\', '')).equivalent(parse(true_program.replace('\\', ''))) for p in top_10_guesses])
45
 
46
  return {
47
  "guess": top_guess,