break down latex file to a linked list, each node use a preserve flag to indicate whether it should be proccessed by GPT. P.S. use multiprocessing to avoid timeout error
(self, txt, project_folder, opts)
| 148 | |
| 149 | |
| 150 | def split(self, txt, project_folder, opts): |
| 151 | """ |
| 152 | break down latex file to a linked list, |
| 153 | each node use a preserve flag to indicate whether it should |
| 154 | be proccessed by GPT. |
| 155 | P.S. use multiprocessing to avoid timeout error |
| 156 | """ |
| 157 | import multiprocessing |
| 158 | manager = multiprocessing.Manager() |
| 159 | return_dict = manager.dict() |
| 160 | p = multiprocessing.Process( |
| 161 | target=split_subprocess, |
| 162 | args=(txt, project_folder, return_dict, opts)) |
| 163 | p.start() |
| 164 | p.join() |
| 165 | p.close() |
| 166 | self.nodes = return_dict['nodes'] |
| 167 | self.sp = return_dict['segment_parts_for_gpt'] |
| 168 | return self.sp |
| 169 | |
| 170 | |
| 171 | class LatexPaperFileGroup(): |