Spaces:
Sleeping
Sleeping
Create app.py
Browse files
app.py
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import gradio as gr
|
| 2 |
+
from question_extractor import hf_predict
|
| 3 |
+
|
| 4 |
+
def predict(file):
|
| 5 |
+
return hf_predict(file)
|
| 6 |
+
|
| 7 |
+
iface = gr.Interface(
|
| 8 |
+
fn=predict,
|
| 9 |
+
inputs=gr.File(type="filepath", label="file"),
|
| 10 |
+
outputs="text",
|
| 11 |
+
title="Question Paper Extractor",
|
| 12 |
+
description="Upload a question paper image or PDF and get extracted questions.",
|
| 13 |
+
)
|
| 14 |
+
|
| 15 |
+
if __name__ == "__main__":
|
| 16 |
+
iface.launch()
|