Fix: Remove device_map to prevent meta tensor errors in table detection by micmarty-deepsense · Pull Request #459 · Unstructured-IO/unstructured-inference

added 2 commits

January 27, 2026 14:21
The device_map parameter with HuggingFace Transformers can cause
NotImplementedError "Cannot copy out of meta tensor" in multi-threaded
contexts when loading TableTransformerForObjectDetection models.

This fix:
- Removes device_map from DetrImageProcessor.from_pretrained()
- Removes device_map from TableTransformerForObjectDetection.from_pretrained()
- Uses explicit .to(device) after model loading instead

This pattern matches the fix applied to SentenceTransformer models in
core-product (commits c8b175f7 and db636932).

Error observed in in-vpc customer deployment when using strategy=fast with table detection.
…rors

Removed manual bitmap.close() and page.close() calls in convert_pdf_to_image()
to prevent pypdfium2 AssertionError during concurrent PDF processing.

Issue: When manually closing child objects (bitmap, page) followed by parent
PDF close, pypdfium2's weakref finalizers can run after parent closes,
triggering assertion failures in cleanup logic.

Solution: Let pypdfium2 finalizers handle resource cleanup automatically.
This prevents double-cleanup race conditions and simplifies code.

Version: Bumped to 1.1.9