diff --git a/tensorflow_lite_support/metadata/python/metadata_writers/bert_nl_classifier.py b/tensorflow_lite_support/metadata/python/metadata_writers/bert_nl_classifier.py index 1f34bcfc8..f95ce7125 100644 --- a/tensorflow_lite_support/metadata/python/metadata_writers/bert_nl_classifier.py +++ b/tensorflow_lite_support/metadata/python/metadata_writers/bert_nl_classifier.py @@ -76,7 +76,7 @@ def create_from_metadata_info( return cls.create_from_metadata( model_buffer, model_metadata=general_md.create_metadata(), - input_metadata=input_md.create_input_tesnor_metadata(), + input_metadata=input_md.create_input_tensor_metadata(), output_metadata=[output_md.create_metadata()], associated_files=[ file.file_path for file in output_md.associated_files @@ -108,7 +108,7 @@ def create_for_inference( Args: model_buffer: valid buffer of the model file. tokenizer_md: information of the tokenizer used to process the input - string, if any. Supported tokenziers are: `BertTokenizer` [1] and + string, if any. Supported tokenizers are: `BertTokenizer` [1] and `SentencePieceTokenizer` [2]. If the tokenizer is `RegexTokenizer` [3], refer to `nl_classifier.MetadataWriter`. [1]: diff --git a/tensorflow_lite_support/metadata/python/metadata_writers/metadata_info.py b/tensorflow_lite_support/metadata/python/metadata_writers/metadata_info.py index b1b6c1cd8..4a8488d48 100644 --- a/tensorflow_lite_support/metadata/python/metadata_writers/metadata_info.py +++ b/tensorflow_lite_support/metadata/python/metadata_writers/metadata_info.py @@ -789,8 +789,8 @@ def __init__(self, self._tokenizer_md = tokenizer_md - def create_input_tesnor_metadata(self) -> List[_metadata_fb.TensorMetadataT]: - """Creates the input metadata for the three input tesnors.""" + def create_input_tensor_metadata(self) -> List[_metadata_fb.TensorMetadataT]: + """Creates the input metadata for the three input tensors.""" # The order of the three input tensors may vary with each model conversion. # We need to order the input metadata according to the tensor order in the # model. diff --git a/tensorflow_lite_support/python/task/audio/core/audio_record.py b/tensorflow_lite_support/python/task/audio/core/audio_record.py index e3b2eb7ea..45c8c5c29 100644 --- a/tensorflow_lite_support/python/task/audio/core/audio_record.py +++ b/tensorflow_lite_support/python/task/audio/core/audio_record.py @@ -48,11 +48,11 @@ def __init__(self, channels: int, sampling_rate: int, raise sd_error if channels <= 0: - raise ValueError('channels must be postive.') + raise ValueError('channels must be positive.') if sampling_rate <= 0: - raise ValueError('sampling_rate must be postive.') + raise ValueError('sampling_rate must be positive.') if buffer_size <= 0: - raise ValueError('buffer_size must be postive.') + raise ValueError('buffer_size must be positive.') self._audio_buffer = [] self._buffer_size = buffer_size