Skip to content

Commit c431935

Browse files
authored
Chore: nit of table init logger to show up the log info (#290)
`"Loading the table structure model ..."` wasn't showing up in log since it was using `logging.info` not `logger.info`
1 parent a7031cc commit c431935

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
## 0.7.13-dev0
1+
## 0.7.13-dev1
22

3+
* fix: update logger in table initalization where the logger info was not showing
34
* chore: supress UserWarning about specified model providers
45

56
## 0.7.12
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "0.7.13-dev0" # pragma: no cover
1+
__version__ = "0.7.13-dev1" # pragma: no cover

unstructured_inference/models/tables.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# https://github.com/microsoft/table-transformer/blob/main/src/inference.py
22
# https://github.com/NielsRogge/Transformers-Tutorials/blob/master/Table%20Transformer/Using_Table_Transformer_for_table_detection_and_table_structure_recognition.ipynb
3-
import logging
43
import os
54
import xml.etree.ElementTree as ET
65
from collections import defaultdict
@@ -63,13 +62,13 @@ def initialize(
6362
self.feature_extractor = DetrImageProcessor()
6463

6564
try:
66-
logging.info("Loading the table structure model ...")
65+
logger.info("Loading the table structure model ...")
6766
self.model = TableTransformerForObjectDetection.from_pretrained(model)
6867
self.model.eval()
6968

7069
except EnvironmentError:
71-
logging.critical("Failed to initialize the model.")
72-
logging.critical("Ensure that the model is correct")
70+
logger.critical("Failed to initialize the model.")
71+
logger.critical("Ensure that the model is correct")
7372
raise ImportError(
7473
"Review the parameters to initialize a UnstructuredTableTransformerModel obj",
7574
)

0 commit comments

Comments
 (0)