Spaces:
Build error
Build error
Commit
·
61cf92f
1
Parent(s):
6f414fd
Cached examples
Browse files
app.py
CHANGED
|
@@ -270,8 +270,8 @@ with gr.Blocks(theme=gr.themes.Soft()) as demo:
|
|
| 270 |
pdf_input = gr.components.File(label="PDF File")
|
| 271 |
|
| 272 |
with gr.Row():
|
| 273 |
-
model_input = gr.components.Dropdown(['it5/it5-
|
| 274 |
-
value=
|
| 275 |
question_input = gr.components.Dropdown(["Quanti metri quadri misura l'immobile?"],
|
| 276 |
value = "Quanti metri quadri misura l'immobile?", label = 'Question')
|
| 277 |
|
|
@@ -294,6 +294,7 @@ with gr.Blocks(theme=gr.themes.Soft()) as demo:
|
|
| 294 |
extract_button.click(fn = ocr_interface,
|
| 295 |
inputs=[pdf_input, model_input, question_input], outputs=[values_output, total_output, text_output])
|
| 296 |
|
| 297 |
-
gr.Examples(['Example1(scanned).pdf', 'Example2.pdf', 'Example3Large.pdf'], inputs = pdf_input
|
|
|
|
| 298 |
|
| 299 |
demo.launch()
|
|
|
|
| 270 |
pdf_input = gr.components.File(label="PDF File")
|
| 271 |
|
| 272 |
with gr.Row():
|
| 273 |
+
model_input = gr.components.Dropdown(['it5/it5-base-question-answering', 'it5/it5-small-question-answering'],
|
| 274 |
+
value='it5/it5-base-question-answering', label = 'Select model')
|
| 275 |
question_input = gr.components.Dropdown(["Quanti metri quadri misura l'immobile?"],
|
| 276 |
value = "Quanti metri quadri misura l'immobile?", label = 'Question')
|
| 277 |
|
|
|
|
| 294 |
extract_button.click(fn = ocr_interface,
|
| 295 |
inputs=[pdf_input, model_input, question_input], outputs=[values_output, total_output, text_output])
|
| 296 |
|
| 297 |
+
gr.Examples(['Example1(scanned).pdf', 'Example2.pdf', 'Example3Large.pdf'], inputs = pdf_input,
|
| 298 |
+
cache_examples = True, fn = ocr_interface, outputs = [values_output, total_output, text_output])
|
| 299 |
|
| 300 |
demo.launch()
|