Skip to content

Commit

Permalink
Shut up coreml version incompatibility warnings
Browse files Browse the repository at this point in the history
We don't use any of the functionality they pertain to
  • Loading branch information
mittagessen committed Jun 25, 2024
1 parent c36af21 commit 491e95a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
8 changes: 4 additions & 4 deletions kraken/lib/layers.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
from torch.nn import functional as F
from torch.nn.utils.rnn import pack_padded_sequence, pad_packed_sequence

logger = logging.getLogger('coremltools')
logger.setLevel(logging.ERROR)
root_logger = logging.getLogger()
level = root_logger.getEffectiveLevel()
root_logger.setLevel(logging.ERROR)
from coremltools.proto import NeuralNetwork_pb2 # NOQA

logger.setLevel(logging.WARNING)
root_logger.setLevel(level)

# all tensors are ordered NCHW, the "feature" dimension is C, so the output of
# an LSTM will be put into C same as the filters of a CNN.
Expand Down
9 changes: 7 additions & 2 deletions kraken/lib/vgsl.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,20 @@
Tuple, Union)

import torch
from coremltools.models import MLModel, datatypes
from coremltools.models.neural_network import NeuralNetworkBuilder
from google.protobuf.message import DecodeError
from torch import nn

from kraken.lib import layers
from kraken.lib.codec import PytorchCodec
from kraken.lib.exceptions import KrakenInvalidModelException

root_logger = logging.getLogger()
level = root_logger.getEffectiveLevel()
root_logger.setLevel(logging.ERROR)
from coremltools.models import MLModel, datatypes
from coremltools.models.neural_network import NeuralNetworkBuilder
root_logger.setLevel(level)

# all tensors are ordered NCHW, the "feature" dimension is C, so the output of
# an LSTM will be put into C same as the filters of a CNN.

Expand Down

0 comments on commit 491e95a

Please sign in to comment.