Spaces:
Runtime error
Runtime error
Rehman1603
commited on
Commit
•
f8ff5d1
1
Parent(s):
a8d2a99
Update app.py
Browse files
app.py
CHANGED
@@ -29,9 +29,17 @@ def MCQGenerator(image):
|
|
29 |
}
|
30 |
Mcqs=predict_mcq(text)
|
31 |
data=Mcqs.get('questions')
|
32 |
-
|
33 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
34 |
|
35 |
-
iface=gr.Interface(fn=MCQGenerator,inputs="image",outputs=[gr.components.Textbox(label="
|
36 |
examples=[['demo.PNG']])
|
37 |
iface.launch(debug=True)
|
|
|
29 |
}
|
30 |
Mcqs=predict_mcq(text)
|
31 |
data=Mcqs.get('questions')
|
32 |
+
print(data)
|
33 |
+
#final_result=put_in_single_list(data)
|
34 |
+
statement=""
|
35 |
+
answer=""
|
36 |
+
options=""
|
37 |
+
for mcq in data:
|
38 |
+
statement+=mcq.get('question_statement')+','
|
39 |
+
answer+=mcq.get('answer')+','
|
40 |
+
options+=mcq.get('options')[0]+','+mcq.get('options')[1]+','+mcq.get('options')[2]+','
|
41 |
+
return statement,answer,options
|
42 |
|
43 |
+
iface=gr.Interface(fn=MCQGenerator,inputs="image",outputs=[gr.components.Textbox(label="Question"),gr.components.Textbox(label="Answer"),gr.components.Textbox(label="Options")],
|
44 |
examples=[['demo.PNG']])
|
45 |
iface.launch(debug=True)
|