Spaces:
Runtime error
Runtime error
Fix another bug
Browse files
app.py
CHANGED
|
@@ -49,7 +49,7 @@ def process_image(image):
|
|
| 49 |
width, height = image.size
|
| 50 |
|
| 51 |
# encode
|
| 52 |
-
encoding = processor(
|
| 53 |
offset_mapping = encoding.pop('offset_mapping')
|
| 54 |
|
| 55 |
# forward pass
|
|
|
|
| 49 |
width, height = image.size
|
| 50 |
|
| 51 |
# encode
|
| 52 |
+
encoding = processor(image, truncation=True, return_offsets_mapping=True, return_tensors="pt")
|
| 53 |
offset_mapping = encoding.pop('offset_mapping')
|
| 54 |
|
| 55 |
# forward pass
|