diff --git a/marker/processors/llm/llm_table_merge.py b/marker/processors/llm/llm_table_merge.py index e2012998..af512bf6 100644 --- a/marker/processors/llm/llm_table_merge.py +++ b/marker/processors/llm/llm_table_merge.py @@ -114,6 +114,9 @@ class LLMTableMergeProcessor(BaseLLMProcessor): @staticmethod def get_row_count(cells: List[TableCell]): + if not cells: + return 0 + max_rows = None for col_id in set([cell.col_id for cell in cells]): col_cells = [cell for cell in cells if cell.col_id == col_id] @@ -126,6 +129,9 @@ def get_row_count(cells: List[TableCell]): @staticmethod def get_column_count(cells: List[TableCell]): + if not cells: + return 0 + max_cols = None for row_id in set([cell.row_id for cell in cells]): row_cells = [cell for cell in cells if cell.row_id == row_id]