Skip to content

Commit

Permalink
Remove more prints
Browse files Browse the repository at this point in the history
Signed-off-by: Christoph Auer <[email protected]>
  • Loading branch information
cau-git committed Dec 11, 2024
1 parent e890b7c commit 2a36082
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,10 @@ def _get_good_bad_cells_in_column(self, table_cells, column, matches):
if cell["cell_class"] <= 1:
allow_class = False
else:
print("***")
print("no cell_class in...")
print(cell)
print("***")
self._log.debug("***")
self._log.debug("no cell_class in...")
self._log.debug(cell)
self._log.debug("***")
if allow_class:
match_list = matches[pdf_cell_id]
for match in match_list:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ def _build_table_cells(self, html_seq, otsl_seq, bboxes, table_classes):
r, o = otsl.html_to_otsl(table_html_structure, None, False, False, True, False)
if not r:
ermsg = "ERR#: COULD NOT CONVERT TO RS THIS TABLE TO COMPUTE SPANS"
print(ermsg)
self._log.debug(ermsg)
else:
otsl_spans = o["otsl_spans"]

Expand Down
11 changes: 6 additions & 5 deletions docling_ibm_models/tableformer/data_management/tf_predictor.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
# LOG_LEVEL = logging.DEBUG
LOG_LEVEL = logging.WARN

logger = s.get_custom_logger(__name__, LOG_LEVEL)

class bcolors:
HEADER = "\033[95m"
Expand All @@ -53,26 +54,26 @@ def otsl_sqr_chk(rs_list, logdebug):

totcelnum = rs_list.count("fcel") + rs_list.count("ecel")
if logdebug:
print("Total number of cells = {}".format(totcelnum))
logger.debug("Total number of cells = {}".format(totcelnum))

for ind, ln in enumerate(rs_list_split):
ln.append("nl")
if logdebug:
print("{}".format(ln))
logger.debug("{}".format(ln))
if len(ln) != init_tag_len:
isSquare = False
if isSquare:
if logdebug:
print(
logger.debug(
"{}*OK* Table is square! *OK*{}".format(
bcolors.OKGREEN, bcolors.ENDC
)
)
else:
if logdebug:
err_name = "{}***** ERR ******{}"
print(err_name.format(bcolors.FAIL, bcolors.ENDC))
print(
logger.debug(err_name.format(bcolors.FAIL, bcolors.ENDC))
logger.debug(
"{}*ERR* Table is not square! *ERR*{}".format(
bcolors.FAIL, bcolors.ENDC
)
Expand Down

0 comments on commit 2a36082

Please sign in to comment.