Skip to content

Commit 90420c5

Browse files
committed
Fix mypy error
1 parent 5a6b748 commit 90420c5

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

app/backend/prepdocslib/textsplitter.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import re
33
from abc import ABC
44
from collections.abc import Generator
5+
from typing import Optional
56

67
import tiktoken
78

@@ -195,7 +196,7 @@ def split_pages(self, pages: list[Page]) -> Generator[SplitPage, None, None]:
195196
"""
196197
figure_regex = re.compile(r"<figure.*?</figure>", re.IGNORECASE | re.DOTALL)
197198

198-
previous_chunk: SplitPage | None = None
199+
previous_chunk: Optional[SplitPage] = None
199200

200201
for page in pages:
201202
raw = page.text or ""

0 commit comments

Comments
 (0)