Spaces:
Runtime error
Runtime error
feat: display pretty json objects
Browse files
app.py
CHANGED
@@ -94,13 +94,16 @@ if information == 'Extract all!':
|
|
94 |
st.text(f'parsing 🧾 (extracting all)...')
|
95 |
pretrained_model, processor, task_prompt = pretrained_model_a, processor_a, f"<s>"
|
96 |
pretrained_model.to(device)
|
97 |
-
parsed_receipt_info_a = run_prediction(image)
|
98 |
pretrained_model, processor, task_prompt = pretrained_model_b, processor_b, f"<s_cord-v2>"
|
99 |
pretrained_model.to(device)
|
100 |
-
parsed_receipt_info_b = run_prediction(image)
|
101 |
-
st.
|
102 |
-
st.
|
|
|
|
|
103 |
else:
|
104 |
st.text(f'parsing 🧾...')
|
105 |
-
parsed_receipt_info = run_prediction(image)
|
106 |
-
st.
|
|
|
|
94 |
st.text(f'parsing 🧾 (extracting all)...')
|
95 |
pretrained_model, processor, task_prompt = pretrained_model_a, processor_a, f"<s>"
|
96 |
pretrained_model.to(device)
|
97 |
+
parsed_receipt_info_a, _ = run_prediction(image)
|
98 |
pretrained_model, processor, task_prompt = pretrained_model_b, processor_b, f"<s_cord-v2>"
|
99 |
pretrained_model.to(device)
|
100 |
+
parsed_receipt_info_b, _ = run_prediction(image)
|
101 |
+
st.text(f'\nRaw output a:')
|
102 |
+
st.json(parsed_receipt_info_a)
|
103 |
+
st.text(f'\nRaw output b:')
|
104 |
+
st.json(parsed_receipt_info_b)
|
105 |
else:
|
106 |
st.text(f'parsing 🧾...')
|
107 |
+
parsed_receipt_info, _ = run_prediction(image)
|
108 |
+
st.text(f'\nRaw output')
|
109 |
+
st.json(parsed_receipt_info)
|