Spaces:
Build error
Build error
Heiko Hotz
commited on
Commit
•
5ad0224
1
Parent(s):
4b9c730
initial commit
Browse files- app.py +2 -1
- predict.py +1 -1
app.py
CHANGED
@@ -145,7 +145,8 @@ if st.button('Analyze'):
|
|
145 |
data['context']=paragraph
|
146 |
print(data)
|
147 |
|
148 |
-
predictions = run_prediction(data['question'], data['context'], 'akdeniz27/roberta-base-cuad',
|
|
|
149 |
# print(resp)
|
150 |
# predictions=resp.json()
|
151 |
# print(predictions)
|
|
|
145 |
data['context']=paragraph
|
146 |
print(data)
|
147 |
|
148 |
+
predictions = run_prediction(data['question'], data['context'], 'akdeniz27/roberta-base-cuad',
|
149 |
+
n_best_size=int(number_results))
|
150 |
# print(resp)
|
151 |
# predictions=resp.json()
|
152 |
# print(predictions)
|
predict.py
CHANGED
@@ -102,7 +102,7 @@ def run_prediction(question_texts, context_text, model_path, n_best_size=1):
|
|
102 |
print(all_results)
|
103 |
|
104 |
output_nbest_file = None
|
105 |
-
if
|
106 |
output_nbest_file = "nbest.json"
|
107 |
|
108 |
timer = time.time()
|
|
|
102 |
print(all_results)
|
103 |
|
104 |
output_nbest_file = None
|
105 |
+
if n_best_size > 1:
|
106 |
output_nbest_file = "nbest.json"
|
107 |
|
108 |
timer = time.time()
|