Commit
•
ebb46c8
1
Parent(s):
dca869a
Update app.py
Browse files
app.py
CHANGED
@@ -136,6 +136,17 @@ def app_outputs_by_model(uploaded_pdf, model_id, model, tokenizer, max_length, i
|
|
136 |
|
137 |
return msg, img_files[0], images[0], csv_files[0], df[0]
|
138 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
139 |
# gradio APP
|
140 |
with gr.Blocks(title="Inference APP for Document Understanding at line level (v1 - LiLT base vs LayoutXLM base)", css=".gradio-container") as demo:
|
141 |
gr.HTML("""
|
|
|
136 |
|
137 |
return msg, img_files[0], images[0], csv_files[0], df[0]
|
138 |
|
139 |
+
def app_outputs(uploaded_pdf):
|
140 |
+
msg_lilt, img_files_lilt, images_lilt, csv_files_lilt, df_lilt = app_outputs_by_model(uploaded_pdf,
|
141 |
+
model_id=model_id_lilt, model=model_lilt, tokenizer=tokenizer_lilt,
|
142 |
+
max_length=max_length_lilt, id2label=id2label_lilt, cls_box=cls_box, sep_box=sep_box_lilt)
|
143 |
+
|
144 |
+
msg_layoutxlm, img_files_layoutxlm, images_layoutxlm, csv_files_layoutxlm, df_layoutxlm = app_outputs_by_model(uploaded_pdf,
|
145 |
+
model_id=model_id_layoutxlm, model=model_layoutxlm, tokenizer=tokenizer_layoutxlm,
|
146 |
+
max_length=max_length_layoutxlm, id2label=id2label_layoutxlm, cls_box=cls_box, sep_box=sep_box_layoutxlm)
|
147 |
+
|
148 |
+
return msg_lilt, msg_layoutxlm, img_files_lilt, img_files_layoutxlm, images_lilt, images_layoutxlm, csv_files_lilt, csv_files_layoutxlm, df_lilt, df_layoutxlm
|
149 |
+
|
150 |
# gradio APP
|
151 |
with gr.Blocks(title="Inference APP for Document Understanding at line level (v1 - LiLT base vs LayoutXLM base)", css=".gradio-container") as demo:
|
152 |
gr.HTML("""
|