Spaces:
Running
on
Zero
Running
on
Zero
da03
commited on
Commit
·
09d8750
1
Parent(s):
4fe17ee
app.py
CHANGED
|
@@ -62,7 +62,9 @@ def predict_product(num1, num2):
|
|
| 62 |
output_text = tokenizer.decode(generated_ids[0, input_len:], skip_special_tokens=True)
|
| 63 |
#prediction = postprocess(output_text)
|
| 64 |
predicted_digits_reversed = output_text.strip().split(' ')
|
|
|
|
| 65 |
correct_digits_reversed = ' '.join(correct_product)[::-1]
|
|
|
|
| 66 |
|
| 67 |
# Create the diff for HighlightedText
|
| 68 |
diff = []
|
|
@@ -76,7 +78,7 @@ def predict_product(num1, num2):
|
|
| 76 |
if predicted_digit == '0' and is_correct_sofar:
|
| 77 |
is_correct_digit = True
|
| 78 |
else:
|
| 79 |
-
is_correct_digit =
|
| 80 |
else:
|
| 81 |
if predicted_digit == correct_digit:
|
| 82 |
is_correct_digit = True
|
|
|
|
| 62 |
output_text = tokenizer.decode(generated_ids[0, input_len:], skip_special_tokens=True)
|
| 63 |
#prediction = postprocess(output_text)
|
| 64 |
predicted_digits_reversed = output_text.strip().split(' ')
|
| 65 |
+
print ('p', predicted_digits_reversed)
|
| 66 |
correct_digits_reversed = ' '.join(correct_product)[::-1]
|
| 67 |
+
print ('c', correct_digits_reversed)
|
| 68 |
|
| 69 |
# Create the diff for HighlightedText
|
| 70 |
diff = []
|
|
|
|
| 78 |
if predicted_digit == '0' and is_correct_sofar:
|
| 79 |
is_correct_digit = True
|
| 80 |
else:
|
| 81 |
+
is_correct_digit = False
|
| 82 |
else:
|
| 83 |
if predicted_digit == correct_digit:
|
| 84 |
is_correct_digit = True
|