Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -122,7 +122,7 @@ def extract_invoice_data(file_data, content_type, json_schema):
|
|
| 122 |
|
| 123 |
# Clean and parse JSON output
|
| 124 |
content = response.choices[0].message.content.strip()
|
| 125 |
-
|
| 126 |
|
| 127 |
try:
|
| 128 |
parsed_content = json.loads(cleaned_content)
|
|
|
|
| 122 |
|
| 123 |
# Clean and parse JSON output
|
| 124 |
content = response.choices[0].message.content.strip()
|
| 125 |
+
cleaned_content = content.strip().strip('```json').strip('```')
|
| 126 |
|
| 127 |
try:
|
| 128 |
parsed_content = json.loads(cleaned_content)
|