From 309f7c9b28235d90fc96ab3de018f5d6dde49290 Mon Sep 17 00:00:00 2001 From: Kyle Lo Date: Wed, 11 Oct 2023 08:02:23 -0700 Subject: [PATCH] add slots (#51) --- papermage/magelib/entity.py | 2 ++ papermage/magelib/image.py | 2 ++ 2 files changed, 4 insertions(+) diff --git a/papermage/magelib/entity.py b/papermage/magelib/entity.py index 31b6126..078951f 100644 --- a/papermage/magelib/entity.py +++ b/papermage/magelib/entity.py @@ -16,6 +16,8 @@ class Entity: + __slots__ = ["spans", "boxes", "images", "metadata", "_id", "_doc"] + def __init__( self, spans: Optional[List[Span]] = None, diff --git a/papermage/magelib/image.py b/papermage/magelib/image.py index 190abf6..cb7421d 100644 --- a/papermage/magelib/image.py +++ b/papermage/magelib/image.py @@ -17,6 +17,8 @@ class Image: + __slots__ = ["_pilimage"] + def __init__(self): self._pilimage = None