Skip to content

Commit

Permalink
chore: reduce excessive logging (#353)
Browse files Browse the repository at this point in the history
This PR removes some info level logging that doesn't provide actionable
information.
  • Loading branch information
badGarnet authored May 24, 2024
1 parent 7b2125b commit 64cd41c
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.7.34

* Reduce excessive logging

## 0.7.33

* BREAKING CHANGE: removes legacy detectron2 model
Expand Down
2 changes: 1 addition & 1 deletion unstructured_inference/__version__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.7.33" # pragma: no cover
__version__ = "0.7.34" # pragma: no cover
1 change: 0 additions & 1 deletion unstructured_inference/inference/layout.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,6 @@ def get_elements_with_detection_model(
inplace: bool = True,
) -> Optional[List[LayoutElement]]:
"""Uses specified model to detect the elements on the page."""
logger.info("Detecting page elements ...")
if self.detection_model is None:
model = get_model()
if isinstance(model, UnstructuredObjectDetectionModel):
Expand Down
6 changes: 3 additions & 3 deletions unstructured_inference/models/tables.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ def get_structure(
"""get the table structure as a dictionary contaning different types of elements as
key-value pairs; check table-transformer documentation for more information"""
with torch.no_grad():
logger.info(f"padding image by {pad_for_structure_detection} for structure detection")
encoding = self.feature_extractor(
pad_image_with_background_color(x, pad_for_structure_detection),
return_tensors="pt",
Expand Down Expand Up @@ -122,7 +121,7 @@ def run_prediction(
else:
raise ValueError(
f"result_format {result_format} is not a valid format. "
f'Valid formats are: "html", "dataframe", "cells"'
f'Valid formats are: "html", "dataframe", "cells"',
)

return prediction
Expand Down Expand Up @@ -220,7 +219,8 @@ def outputs_to_objects(


def apply_thresholds_on_objects(
objects: Sequence[Mapping[str, Any]], thresholds: Mapping[str, float]
objects: Sequence[Mapping[str, Any]],
thresholds: Mapping[str, float],
) -> Sequence[Mapping[str, Any]]:
"""
Filters predicted objects which the confidence scores below the thresholds
Expand Down

0 comments on commit 64cd41c

Please sign in to comment.