original_docstring: Returns the serving input function.
  
    Args:
      model: An initialized :class:`opennmt.models.model.Model` instance.
      metadata: Optional data configuration (to be removed). Some inputters
        currently require to peek into some data files to infer input sizes.
  
    Returns:
      A callable that returns a ``tf.estimator.export.ServingInputReceiver``.
    
docstring: Returns the serving input function.
docstring_tokens: Returns the serving input function .
code: def make_serving_input_fn(model, metadata=None):
    """Returns the serving input function.
  
    Args:
      model: An initialized :class:`opennmt.models.model.Model` instance.
      metadata: Optional data configuration (to be removed). Some inputters
        currently require to peek into some data files to infer input sizes.
  
    Returns:
      A callable that returns a ``tf.estimator.export.ServingInputReceiver``.
    """
  
    def _fn():
      local_model = copy.deepcopy(model)
      # This is a hack for SequenceRecordInputter that currently infers the input
      # depth from the data files.
      # TODO: This function should not require the training data.
      if metadata is not None and "train_features_file" in metadata:
        _ = local_model.features_inputter.make_dataset(metadata["train_features_file"])
      return local_model.features_inputter.get_serving_input_receiver()
  
    return _fn
code_tokens: def make_serving_input_fn ( model , metadata = None ) : def _fn ( ) : local_model = copy . deepcopy ( model ) if metadata is not None and "train_features_file" in metadata : _ = local_model . features_inputter . make_dataset ( metadata [ "train_features_file" ] ) return local_model . features_inputter . get_serving_input_receiver ( ) return _fn
short_docstring: Returns the serving input function.
short_docstring_tokens: Returns the serving input function .
comment: """Returns the serving input function.
  
    Args:
      model: An initialized :class:`opennmt.models.model.Model` instance.
      metadata: Optional data configuration (to be removed). Some inputters
        currently require to peek into some data files to infer input sizes.
  
    Returns:
      A callable that returns a ``tf.estimator.export.ServingInputReceiver``.
    """$SEP$# This is a hack for SequenceRecordInputter that currently infers the input$SEP$# depth from the data files.$SEP$# TODO: This function should not require the training data.