Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -89,15 +89,20 @@ def qa_result(context, question, file, pipe=pipe):
|
|
| 89 |
answered = result['answer']
|
| 90 |
text = remove_references(answered)
|
| 91 |
else:
|
| 92 |
-
if file is None and len(context) == 0 and len(question) == 0:
|
| 93 |
-
|
| 94 |
-
#
|
| 95 |
-
# text = "
|
| 96 |
-
elif len(
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
|
| 100 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 101 |
result = pipe(question=question, context=context)
|
| 102 |
answered = result['answer']
|
| 103 |
text = remove_references(answered)
|
|
|
|
| 89 |
answered = result['answer']
|
| 90 |
text = remove_references(answered)
|
| 91 |
else:
|
| 92 |
+
# if file is None and len(context) == 0 and len(question) == 0:
|
| 93 |
+
# text = "Որպեսզի ես կարողանամ քեզ օգնել, դու պետք է տրամադրես տեքստ կամ ֆայլը, և հարցեր"
|
| 94 |
+
# elif len(context) == 0:
|
| 95 |
+
# text = "Ես չեմ կարողանամ քեզ օգնել եթե դու չտրամադրես տեքստը"
|
| 96 |
+
# elif len(question) == 0:
|
| 97 |
+
# text = "Ես չեմ կարողանամ քեզ օգնել եթե դու չտաս հարցը"
|
| 98 |
+
if len(context) == 0:
|
| 99 |
+
if len(question) == 0:
|
| 100 |
+
text = "Որպեսզի ես կարողանամ քեզ օգնել, դու պետք է տրամադրես տեքստ կամ ֆայլը, և հարցեր"
|
| 101 |
+
else:
|
| 102 |
+
text = "Ես չեմ կարողանամ քեզ օգնել եթե դու չտրամադրես տեքստը"
|
| 103 |
+
elif len(question) == 0:
|
| 104 |
+
text = "Ես չեմ կարողանամ քեզ օգնել եթե դու չտաս հարցը"
|
| 105 |
+
else:
|
| 106 |
result = pipe(question=question, context=context)
|
| 107 |
answered = result['answer']
|
| 108 |
text = remove_references(answered)
|