da03 commited on
Commit
d1a789b
1 Parent(s): fe5b36f
Files changed (1) hide show
  1. app.py +6 -6
app.py CHANGED
@@ -91,15 +91,15 @@ def predict_product(num1, num2):
91
  predicted_annotations = []
92
  is_correct_sofar = True
93
  if model_name == 'implicit':
94
- num_equal_signs = sum([1 for token in predicted_digits_reversed if token == '='])
95
- if num_equal_signs < 2:
96
  predicted_annotations = [(predicted_digit, None) for predicted_digit in predicted_digits_reversed]
97
  predicted_digits_reversed = []
98
  else:
99
- first_equal_sign_position = predicted_digits_reversed.index('=')
100
- second_equal_sign_position = predicted_digits_reversed[first_equal_sign_position+1:].index('=') + first_equal_sign_position+1
101
- predicted_annotations = [(predicted_digit, None) for predicted_digit in predicted_digits_reversed[:second_equal_sign_position+1]]
102
- predicted_digits_reversed = predicted_digits_reversed[second_equal_sign_position+1:]
103
 
104
  for i in range(len(predicted_digits_reversed)):
105
  predicted_digit = predicted_digits_reversed[i]
 
91
  predicted_annotations = []
92
  is_correct_sofar = True
93
  if model_name == 'implicit':
94
+ if '=' not in predicted_digits_reversed:
95
+ print ('aaa')
96
  predicted_annotations = [(predicted_digit, None) for predicted_digit in predicted_digits_reversed]
97
  predicted_digits_reversed = []
98
  else:
99
+ print ('bbbaaa')
100
+ equal_sign_position = predicted_digits_reversed.index('=')
101
+ predicted_annotations = [(predicted_digit, None) for predicted_digit in predicted_digits_reversed[:equal_sign_position+1]]
102
+ predicted_digits_reversed = predicted_digits_reversed[equal_sign_position+1:]
103
 
104
  for i in range(len(predicted_digits_reversed)):
105
  predicted_digit = predicted_digits_reversed[i]