Spaces:
Runtime error
Runtime error
Commit
·
881c1d5
1
Parent(s):
a3695fb
Update app.py
Browse files
app.py
CHANGED
@@ -86,7 +86,7 @@ def predict_answers(inputs):
|
|
86 |
flag = False
|
87 |
for start_index in start_indexes:
|
88 |
for end_index in end_indexes:
|
89 |
-
|
90 |
if offset[start_index] is None or offset[end_index] is None:
|
91 |
continue
|
92 |
# skip answer with length that is either < 0
|
@@ -97,7 +97,7 @@ def predict_answers(inputs):
|
|
97 |
predicted_answer.append(answer)
|
98 |
break
|
99 |
if flag:
|
100 |
-
|
101 |
if not flag:
|
102 |
predicted_answer.append(answer)
|
103 |
return {"predicted_answer":predicted_answer}
|
|
|
86 |
flag = False
|
87 |
for start_index in start_indexes:
|
88 |
for end_index in end_indexes:
|
89 |
+
# skip answer that are not in the context.
|
90 |
if offset[start_index] is None or offset[end_index] is None:
|
91 |
continue
|
92 |
# skip answer with length that is either < 0
|
|
|
97 |
predicted_answer.append(answer)
|
98 |
break
|
99 |
if flag:
|
100 |
+
break
|
101 |
if not flag:
|
102 |
predicted_answer.append(answer)
|
103 |
return {"predicted_answer":predicted_answer}
|