Skip to content

Commit

Permalink
switch to vanilla enum and fix bug in page header processor and json …
Browse files Browse the repository at this point in the history
…dump
  • Loading branch information
iammosespaulr committed Dec 3, 2024
1 parent 11349b2 commit fe39d8b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion marker/processors/page_header.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class PageHeaderProcessor(BaseProcessor):
"""
A processor for moving PageHeaders to the top
"""
block_types = (BlockTypes.PageHeader)
block_types = (BlockTypes.PageHeader,)

def __call__(self, document: Document):
for page in document.pages:
Expand Down
2 changes: 1 addition & 1 deletion marker/renderers/json.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class JSONBlockOutput(BaseModel):

class JSONOutput(BaseModel):
children: List[JSONBlockOutput]
block_type: BlockTypes = BlockTypes.Document
block_type: str = str(BlockTypes.Document)
metadata: dict


Expand Down
4 changes: 2 additions & 2 deletions marker/schema/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from enum import auto, StrEnum
from enum import auto, Enum


class BlockTypes(StrEnum):
class BlockTypes(str, Enum):
Line = auto()
Span = auto()
FigureGroup = auto()
Expand Down

0 comments on commit fe39d8b

Please sign in to comment.