Skip to content

Commit

Permalink
Replace usage of warnings with a log at the warn level per PR feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
dagardner-nv committed Jul 25, 2024
1 parent 901ddb3 commit 46adff5
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions examples/log_parsing/postprocessing.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
# limitations under the License.

import json
import logging
import pathlib
import typing
import warnings
from collections import defaultdict

import mrc
Expand All @@ -32,6 +32,8 @@
from morpheus.pipeline.single_port_stage import SinglePortStage
from morpheus.pipeline.stage_schema import StageSchema

logger = logging.getLogger(f"morpheus.{__name__}")


@register_stage("log-postprocess", modes=[PipelineModes.NLP])
class LogParsingPostProcessingStage(SinglePortStage):
Expand Down Expand Up @@ -135,7 +137,7 @@ def __get_label_dicts(self, row):

confidence_dict[self._label_map[label]].append(new_confidence)
else:
warnings.warn(f"Ignoring unexecpected subword token: {text_token}")
logger.warning("Ignoring unexecpected subword token: %s", text_token)

return token_dict, confidence_dict

Expand Down

0 comments on commit 46adff5

Please sign in to comment.