Save doc task visualization (only for doc task). Supports both single result dict and list of results (from PDF).
(self, result, output_path: str)
| 286 | return self.model.save_to_markdown(result, output_path) |
| 287 | |
| 288 | def save_visualization(self, result, output_path: str): |
| 289 | """Save doc task visualization (only for doc task). |
| 290 | Supports both single result dict and list of results (from PDF).""" |
| 291 | if self.task != 'doc': |
| 292 | raise RuntimeError("save_visualization is only available for 'doc' task") |
| 293 | if isinstance(result, list): |
| 294 | for page_result in result: |
| 295 | self.model.save_visualization(page_result, output_path) |
| 296 | else: |
| 297 | return self.model.save_visualization(result, output_path) |
| 298 | |
| 299 | |
| 300 | def main(): |
no outgoing calls