Skip to content

Commit 64cd41c

Browse files
authored
chore: reduce excessive logging (#353)
This PR removes some info level logging that doesn't provide actionable information.
1 parent 7b2125b commit 64cd41c

File tree

4 files changed

+8
-5
lines changed

4 files changed

+8
-5
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 0.7.34
2+
3+
* Reduce excessive logging
4+
15
## 0.7.33
26

37
* BREAKING CHANGE: removes legacy detectron2 model
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "0.7.33" # pragma: no cover
1+
__version__ = "0.7.34" # pragma: no cover

unstructured_inference/inference/layout.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,6 @@ def get_elements_with_detection_model(
177177
inplace: bool = True,
178178
) -> Optional[List[LayoutElement]]:
179179
"""Uses specified model to detect the elements on the page."""
180-
logger.info("Detecting page elements ...")
181180
if self.detection_model is None:
182181
model = get_model()
183182
if isinstance(model, UnstructuredObjectDetectionModel):

unstructured_inference/models/tables.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,6 @@ def get_structure(
8484
"""get the table structure as a dictionary contaning different types of elements as
8585
key-value pairs; check table-transformer documentation for more information"""
8686
with torch.no_grad():
87-
logger.info(f"padding image by {pad_for_structure_detection} for structure detection")
8887
encoding = self.feature_extractor(
8988
pad_image_with_background_color(x, pad_for_structure_detection),
9089
return_tensors="pt",
@@ -122,7 +121,7 @@ def run_prediction(
122121
else:
123122
raise ValueError(
124123
f"result_format {result_format} is not a valid format. "
125-
f'Valid formats are: "html", "dataframe", "cells"'
124+
f'Valid formats are: "html", "dataframe", "cells"',
126125
)
127126

128127
return prediction
@@ -220,7 +219,8 @@ def outputs_to_objects(
220219

221220

222221
def apply_thresholds_on_objects(
223-
objects: Sequence[Mapping[str, Any]], thresholds: Mapping[str, float]
222+
objects: Sequence[Mapping[str, Any]],
223+
thresholds: Mapping[str, float],
224224
) -> Sequence[Mapping[str, Any]]:
225225
"""
226226
Filters predicted objects which the confidence scores below the thresholds

0 commit comments

Comments
 (0)