class_docstr: Wrapper for querying a TFX-generated SavedModel.
class_docstr_tok: ["Wrapper","for","querying","a","TFX-generated","SavedModel","."]
code: def predict_minibatch(  # pytype: disable=signature-mismatch  # overriding-return-type-checks
      self, inputs: list[lit_types.JsonDict]
  ) -> Iterator[lit_types.JsonDict]:
      for i in inputs:
          filtered_inputs = {
              k: v for k, v in i.items() if k in self._input_spec
          }
          result = self._model.signatures[self._signature](
              tf.constant(
                  [_inputs_to_serialized_example(filtered_inputs)]
              )
          )
          result = {
              k: tf.squeeze(v).numpy().tolist()
              for k, v in result.items()
              if k in self._output_spec
          }
          for k, v in result.items():
              # If doing Multiclass Prediction for a Binary Classifier.
              if isinstance(
                  self._output_spec[k], lit_types.MulticlassPreds
              ) and not isinstance(v, list):
                  result[k] = [1 - v, v]
          yield result
  
file_path: lit/lit_nlp/components/tfx_model.py
imports: from collections.abc import Iterator
  import attr
  from lit_nlp.api import model
  from lit_nlp.api import types
  import tensorflow
  import tensorflow_text
label_desc: Use image node_id 2 for calling the TFXModel obj's underlying member method code with example usage: obj.predict_minibatch(inputs) without return types