Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
@@ -106,12 +106,15 @@ def process_document(image):
|
|
106 |
generated_ids_trimmed, skip_special_tokens=True, clean_up_tokenization_spaces=False
|
107 |
)
|
108 |
print("8")
|
|
|
109 |
|
110 |
# Handle output text to convert it into JSON
|
111 |
try:
|
|
|
112 |
almost_json = output_text[0].split('\n')[-1].split('\n')[0]
|
113 |
json = literal_eval(almost_json)
|
114 |
-
except:
|
|
|
115 |
json = output_text[0] # Return raw output if JSON parsing fails
|
116 |
|
117 |
# Optionally, you can delete the temporary file after use
|
|
|
106 |
generated_ids_trimmed, skip_special_tokens=True, clean_up_tokenization_spaces=False
|
107 |
)
|
108 |
print("8")
|
109 |
+
print("output_text ---->>>>", output_text)
|
110 |
|
111 |
# Handle output text to convert it into JSON
|
112 |
try:
|
113 |
+
print("Trying ......")
|
114 |
almost_json = output_text[0].split('\n')[-1].split('\n')[0]
|
115 |
json = literal_eval(almost_json)
|
116 |
+
except Exception as e:
|
117 |
+
print(f"Got error {e}")
|
118 |
json = output_text[0] # Return raw output if JSON parsing fails
|
119 |
|
120 |
# Optionally, you can delete the temporary file after use
|