Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -209,7 +209,7 @@ def analyze_image(img, pdf, max_datapoints):
|
|
| 209 |
out = dp.as_dict()
|
| 210 |
jsonl_out.append(out)
|
| 211 |
out.pop("_image")
|
| 212 |
-
layout_items = dp.layouts
|
| 213 |
layout_items.sort(key=lambda x: x.reading_order)
|
| 214 |
layout_items_str += f"\n\n -------- PAGE NUMBER: {dp.page_number+1} ------------- \n"
|
| 215 |
for item in layout_items:
|
|
|
|
| 209 |
out = dp.as_dict()
|
| 210 |
jsonl_out.append(out)
|
| 211 |
out.pop("_image")
|
| 212 |
+
layout_items = [layout for layout in dp.layouts if layout.reading_order is not None]
|
| 213 |
layout_items.sort(key=lambda x: x.reading_order)
|
| 214 |
layout_items_str += f"\n\n -------- PAGE NUMBER: {dp.page_number+1} ------------- \n"
|
| 215 |
for item in layout_items:
|