Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -119,7 +119,7 @@ def extract_invoice_data(file_data, content_type, json_schema):
|
|
| 119 |
temperature=0.5,
|
| 120 |
max_tokens=16384
|
| 121 |
)
|
| 122 |
-
|
| 123 |
# Clean and parse JSON output
|
| 124 |
content = response.choices[0].message.content.strip()
|
| 125 |
cleaned_content = content.strip().strip('```json').strip('```')
|
|
@@ -187,6 +187,7 @@ def extract_text_from_file(
|
|
| 187 |
"file_key": file_key,
|
| 188 |
"file_type": content_type,
|
| 189 |
"document_type": document_type,
|
|
|
|
| 190 |
"entityrefkey": entity_ref_key,
|
| 191 |
"extracted_data": extracted_data
|
| 192 |
}
|
|
|
|
| 119 |
temperature=0.5,
|
| 120 |
max_tokens=16384
|
| 121 |
)
|
| 122 |
+
base64dataresp = f"data:{mime_type};base64,{base64_encoded}"
|
| 123 |
# Clean and parse JSON output
|
| 124 |
content = response.choices[0].message.content.strip()
|
| 125 |
cleaned_content = content.strip().strip('```json').strip('```')
|
|
|
|
| 187 |
"file_key": file_key,
|
| 188 |
"file_type": content_type,
|
| 189 |
"document_type": document_type,
|
| 190 |
+
"base64dataResp":base64dataresp,
|
| 191 |
"entityrefkey": entity_ref_key,
|
| 192 |
"extracted_data": extracted_data
|
| 193 |
}
|