Spaces:
Build error
Build error
Commit
·
5e22f3f
1
Parent(s):
20f0ac1
Update app.py
Browse filesFixed deprecated warnings
app.py
CHANGED
|
@@ -268,13 +268,13 @@ with gr.Blocks(theme=gr.themes.Soft()) as demo:
|
|
| 268 |
# PDF Mq Extractor
|
| 269 |
Set the params and switch the tabs to see the output.
|
| 270 |
''')
|
| 271 |
-
with gr.Tab("Extractor"
|
| 272 |
with gr.Row():
|
| 273 |
-
pdf_input = gr.
|
| 274 |
|
| 275 |
with gr.Row():
|
| 276 |
-
model_input = gr.
|
| 277 |
-
question_input = gr.
|
| 278 |
|
| 279 |
with gr.Column():
|
| 280 |
gr.Markdown(
|
|
@@ -285,17 +285,14 @@ with gr.Blocks(theme=gr.themes.Soft()) as demo:
|
|
| 285 |
|
| 286 |
with gr.Row():
|
| 287 |
|
| 288 |
-
values_output = gr.
|
| 289 |
-
total_output = gr.
|
| 290 |
with gr.Row():
|
| 291 |
extract_button = gr.Button("Extract")
|
| 292 |
|
| 293 |
with gr.Tab("Ref. Text"):
|
| 294 |
-
text_output = gr.
|
| 295 |
-
|
| 296 |
extract_button.click(fn = ocr_interface, inputs=[pdf_input, model_input, question_input], outputs=[values_output, total_output, text_output])
|
| 297 |
|
| 298 |
|
| 299 |
-
demo.launch()
|
| 300 |
-
|
| 301 |
-
|
|
|
|
| 268 |
# PDF Mq Extractor
|
| 269 |
Set the params and switch the tabs to see the output.
|
| 270 |
''')
|
| 271 |
+
with gr.Tab("Extractor"):
|
| 272 |
with gr.Row():
|
| 273 |
+
pdf_input = gr.components.File(label="PDF File")
|
| 274 |
|
| 275 |
with gr.Row():
|
| 276 |
+
model_input = gr.components.Dropdown(['it5/it5-base-question-answering', 'it5/it5-small-question-answering'], label = 'Select model')
|
| 277 |
+
question_input = gr.components.Dropdown(["Quanti metri quadri misura l'immobile?"], label = 'Question')
|
| 278 |
|
| 279 |
with gr.Column():
|
| 280 |
gr.Markdown(
|
|
|
|
| 285 |
|
| 286 |
with gr.Row():
|
| 287 |
|
| 288 |
+
values_output = gr.components.Textbox(label="Area Values")
|
| 289 |
+
total_output = gr.components.Textbox(label="Total")
|
| 290 |
with gr.Row():
|
| 291 |
extract_button = gr.Button("Extract")
|
| 292 |
|
| 293 |
with gr.Tab("Ref. Text"):
|
| 294 |
+
text_output = gr.components.Textbox(label="Ref. Text")
|
|
|
|
| 295 |
extract_button.click(fn = ocr_interface, inputs=[pdf_input, model_input, question_input], outputs=[values_output, total_output, text_output])
|
| 296 |
|
| 297 |
|
| 298 |
+
demo.launch()
|
|
|
|
|
|