Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -109,7 +109,7 @@ def extract_invoice_data(file_data, content_type, json_schema):
|
|
| 109 |
if len(images) > 2:
|
| 110 |
raise ValueError("PDF contains more than 2 pages. Only PDFs with 1 or 2 pages are supported.")
|
| 111 |
|
| 112 |
-
for img in images[:2]:
|
| 113 |
img_byte_arr = io.BytesIO()
|
| 114 |
img.save(img_byte_arr, format="PNG")
|
| 115 |
base64_encoded = base64.b64encode(img_byte_arr.getvalue()).decode('utf-8')
|
|
|
|
| 109 |
if len(images) > 2:
|
| 110 |
raise ValueError("PDF contains more than 2 pages. Only PDFs with 1 or 2 pages are supported.")
|
| 111 |
|
| 112 |
+
for img in images[:2]:
|
| 113 |
img_byte_arr = io.BytesIO()
|
| 114 |
img.save(img_byte_arr, format="PNG")
|
| 115 |
base64_encoded = base64.b64encode(img_byte_arr.getvalue()).decode('utf-8')
|