Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -63,5 +63,12 @@ if st.button('Accio Responsa!'):
|
|
63 |
# Perform the querying
|
64 |
QA_input = {'question': query, 'context': context}
|
65 |
res = pipe(QA_input)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
66 |
#out = res.get('answer')
|
67 |
-
|
|
|
63 |
# Perform the querying
|
64 |
QA_input = {'question': query, 'context': context}
|
65 |
res = pipe(QA_input)
|
66 |
+
|
67 |
+
confidence = res.get('score')
|
68 |
+
if confidence > 0.5:
|
69 |
+
st.write(res.get('answer'))
|
70 |
+
else:
|
71 |
+
out = "Sorry dear, I'm not sure"
|
72 |
+
st.write(out)
|
73 |
#out = res.get('answer')
|
74 |
+
|