Spaces:
Sleeping
Sleeping
Commit
·
a196528
1
Parent(s):
7c032c2
Update app.py
Browse files
app.py
CHANGED
@@ -19,20 +19,23 @@ def generate_qna(context,input_radio,q1,q2,q3,q4,q5):
|
|
19 |
dic = {}
|
20 |
keys = []
|
21 |
final_ans = []
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
|
|
|
|
|
|
36 |
|
37 |
def return_lan_para(radio_value):
|
38 |
context = ""
|
|
|
19 |
dic = {}
|
20 |
keys = []
|
21 |
final_ans = []
|
22 |
+
if context.strip():
|
23 |
+
question = [q1,q2,q3,q4,q5]
|
24 |
+
que_list = list(filter(None, question))
|
25 |
+
|
26 |
+
for i in range(len(que_list)):
|
27 |
+
result = Que_ans(question=que_list[i], context=context)
|
28 |
+
final_ans.append(result['answer'])
|
29 |
+
keys.append(str(i))
|
30 |
+
print(final_ans)
|
31 |
+
result_dic = d = [list(j) for j in zip(que_list,final_ans)]
|
32 |
+
dic = dict(zip(keys, final_ans))
|
33 |
+
save_data_and_sendmail(input_radio, context, result_dic)
|
34 |
+
print(dic)
|
35 |
+
|
36 |
+
return dic.get('0',''),dic.get('1',''),dic.get('2',''),dic.get('3',''),dic.get('4','')
|
37 |
+
else:
|
38 |
+
raise gr.Error("Please enter text in inputbox!!!!")
|
39 |
|
40 |
def return_lan_para(radio_value):
|
41 |
context = ""
|