Skip to content

Commit 57ff11b

Browse files
authored
v7.8.0
1 parent 277a436 commit 57ff11b

File tree

2 files changed

+20
-11
lines changed

2 files changed

+20
-11
lines changed

src/document_processor.py

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@
1010
from concurrent.futures import ProcessPoolExecutor, ThreadPoolExecutor, as_completed
1111
from langchain_community.docstore.document import Document
1212
from langchain_text_splitters.character import RecursiveCharacterTextSplitter
13-
from langchain_text_splitters.base import TextSplitter # ← added
14-
# ─ monkey-patch block starts
15-
_old_merge = TextSplitter._merge_splits
16-
def _debug_merge(self, splits, separator):
17-
print(">>> _length_function TYPE *inside* _merge_splits:", type(self._length_function))
18-
return _old_merge(self, splits, separator)
19-
TextSplitter._merge_splits = _debug_merge
20-
# ─ monkey-patch block ends
13+
from langchain_text_splitters.base import TextSplitter
14+
# # ─ monkey-patch block starts
15+
# _old_merge = TextSplitter._merge_splits
16+
# def _debug_merge(self, splits, separator):
17+
# print(">>> _length_function TYPE *inside* _merge_splits:", type(self._length_function))
18+
# return _old_merge(self, splits, separator)
19+
# TextSplitter._merge_splits = _debug_merge
20+
# # ─ monkey-patch block ends
2121
from langchain_community.document_loaders import (
2222
PyMuPDFLoader,
2323
Docx2txtLoader,
@@ -223,8 +223,9 @@ def split_documents(documents=None, text_documents_pdf=None):
223223
keep_separator = False,
224224
)
225225

226-
print("TYPE OF _length_function:", type(text_splitter._length_function))
227-
import time; time.sleep(20)
226+
# DEBUG WITH MONKEY PATCCH
227+
# print("TYPE OF _length_function:", type(text_splitter._length_function))
228+
# import time; time.sleep(20)
228229
"""
229230
Run the script once; if it prints <class 'function'>, the attribute is still correct at creation time and gets corrupted
230231
later, so you’ll know to trace subsequent mutations. If it already shows <class 'list'> (or anything other than function),

src/gui.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,15 @@
1+
import logging, sys
2+
3+
# logging.basicConfig(
4+
# level=logging.DEBUG, # or INFO/ERROR as you prefer
5+
# format="%(asctime)s [%(levelname)s] %(name)s: %(message)s",
6+
# handlers=[logging.StreamHandler(sys.stdout)],
7+
# force=True # clobber any accidental configs
8+
# )
9+
110
import multiprocessing
211
if __name__ == '__main__':
312
multiprocessing.set_start_method('spawn', force=True)
4-
import sys
513
import os
614
from pathlib import Path
715

0 commit comments

Comments
 (0)