Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
|
|
|
|
|
| 1 |
###################################### version 4 NER change done #######################################################
|
| 2 |
|
| 3 |
|
|
@@ -121,15 +123,17 @@ def run_ocr_and_extract(image, temperature=0.2, extraction_mode="Regex"):
|
|
| 121 |
trust_remote_code=True,
|
| 122 |
)
|
| 123 |
|
| 124 |
-
processed_img =
|
| 125 |
-
|
| 126 |
-
|
| 127 |
-
|
| 128 |
-
|
| 129 |
-
|
| 130 |
-
|
| 131 |
-
|
| 132 |
-
]
|
|
|
|
|
|
|
| 133 |
inputs = processor.apply_chat_template(
|
| 134 |
chat,
|
| 135 |
add_generation_prompt=True,
|
|
|
|
| 1 |
+
|
| 2 |
+
|
| 3 |
###################################### version 4 NER change done #######################################################
|
| 4 |
|
| 5 |
|
|
|
|
| 123 |
trust_remote_code=True,
|
| 124 |
)
|
| 125 |
|
| 126 |
+
processed_img = image
|
| 127 |
+
|
| 128 |
+
# processed_img = preprocess_image_for_ocr(image)
|
| 129 |
+
# chat = [
|
| 130 |
+
# {
|
| 131 |
+
# "role": "user",
|
| 132 |
+
# "content": [
|
| 133 |
+
# {"type": "image", "image": processed_img}
|
| 134 |
+
# ],
|
| 135 |
+
# }
|
| 136 |
+
# ]
|
| 137 |
inputs = processor.apply_chat_template(
|
| 138 |
chat,
|
| 139 |
add_generation_prompt=True,
|