@@ -41,23 +41,23 @@ def _load_csv(file: BinaryIO) -> str:
41
41
42
42
43
43
def _load_epub (file : BinaryIO ) -> str :
44
- return convert_text (str (file .read ()), 'plain' , 'epub' ).strip ()
44
+ return convert_text (str (file .read ()), 'plain' , 'epub' , extra_args = [ "+RTS" , "-M4096m" , "-RTS" ] ).strip ()
45
45
46
46
47
47
def _load_docx (file : BinaryIO ) -> str :
48
- return convert_text (str (file .read ()), 'plain' , 'docx' ).strip ()
48
+ return convert_text (str (file .read ()), 'plain' , 'docx' , extra_args = [ "+RTS" , "-M4096m" , "-RTS" ] ).strip ()
49
49
50
50
51
51
def _load_ppt_x (file : BinaryIO ) -> str :
52
52
return _temp_file_wrapper (file , lambda fp : UnstructuredPowerPointLoader (fp ).load ()).strip ()
53
53
54
54
55
55
def _load_rtf (file : BinaryIO ) -> str :
56
- return convert_text (str (file .read ()), 'plain' , 'rtf' ).strip ()
56
+ return convert_text (str (file .read ()), 'plain' , 'rtf' , extra_args = [ "+RTS" , "-M4096m" , "-RTS" ] ).strip ()
57
57
58
58
59
59
def _load_rst (file : BinaryIO ) -> str :
60
- return convert_text (str (file .read ()), 'plain' , 'rst' ).strip ()
60
+ return convert_text (str (file .read ()), 'plain' , 'rst' , extra_args = [ "+RTS" , "-M4096m" , "-RTS" ] ).strip ()
61
61
62
62
63
63
def _load_xml (file : BinaryIO ) -> str :
@@ -71,7 +71,7 @@ def _load_xlsx(file: BinaryIO) -> str:
71
71
72
72
73
73
def _load_odt (file : BinaryIO ) -> str :
74
- return convert_text (str (file .read ()), 'plain' , 'odt' ).strip ()
74
+ return convert_text (str (file .read ()), 'plain' , 'odt' , extra_args = [ "+RTS" , "-M4096m" , "-RTS" ] ).strip ()
75
75
76
76
77
77
def _load_email (file : BinaryIO , ext : str = 'eml' ) -> str | None :
@@ -96,7 +96,7 @@ def attachment_partitioner(
96
96
97
97
98
98
def _load_org (file : BinaryIO ) -> str :
99
- return convert_text (str (file .read ()), 'plain' , 'org' ).strip ()
99
+ return convert_text (str (file .read ()), 'plain' , 'org' , extra_args = [ "+RTS" , "-M4096m" , "-RTS" ] ).strip ()
100
100
101
101
102
102
# -- LOADER FUNCTION MAP -- #
0 commit comments