def METHOD_NAME(
    argv=None, save_main_session=True, test_pipeline=None) -> PipelineResult:
  """
  Args:
    argv: Command line arguments defined for this example.
    save_main_session: Used for internal testing.
    test_pipeline: Used for internal testing.
  """
  known_args, pipeline_args = parse_known_args(argv)
  pipeline_options = PipelineOptions(pipeline_args)
  pipeline_options.view_as(SetupOptions).save_main_session = save_main_session
  # TODO: Remove once nested tensors https://github.com/pytorch/nestedtensor
  # is officially released.
  class OnnxNoBatchModelHandler(OnnxModelHandlerNumpy):
    """Wrapper to OnnxModelHandlerNumpy to limit batch size to 1.
    The tokenized strings generated from RobertaTokenizer may have different
    lengths, which doesn't work with torch.stack() in current RunInference
    implementation since stack() requires tensors to be the same size.
    Restricting max_batch_size to 1 means there is only 1 example per `batch`
    in the run_inference() call.
    """
    def batch_elements_kwargs(self):
      return {'max_batch_size': 1}
  model_handler = OnnxNoBatchModelHandler(model_uri=known_args.model_uri)
  pipeline = test_pipeline
  if not test_pipeline:
    pipeline = beam.Pipeline(options=pipeline_options)
  tokenizer = RobertaTokenizer.from_pretrained('roberta-base')
  text = (pipeline | 'ReadSentences' >> beam.io.ReadFromText(known_args.input))
  text_and_tokenized_text_tuple = (
      text
      | 'FilterEmptyLines' >> beam.ParDo(filter_empty_lines)
      |
      'TokenizeSentence' >> beam.Map(lambda x: tokenize_sentence(x, tokenizer)))
  output = (
      text_and_tokenized_text_tuple
      | 'PyTorchRunInference' >> RunInference(KeyedModelHandler(model_handler))
      | 'ProcessOutput' >> beam.ParDo(PostProcessor()))
  _ = output | "WriteOutput" >> beam.io.WriteToText(
      known_args.output, shard_name_template='', append_trailing_newlines=True)
  result = pipeline.METHOD_NAME()
  result.wait_until_finish()
  return result