code: def runTest(self):
      data = self.spark.createDataFrame(
          [
              [
                  1,
                  """Leonardo Da Vinci invented the microscope?""".strip().replace(
                      "\n", " "
                  ),
              ]
          ]
      ).toDF("id", "text")
  
      document_assembler = (
          DocumentAssembler()
          .setInputCol("text")
          .setOutputCol("documents")
      )
  
      gpt2 = (
          GPT2Transformer.pretrained()
          .setTask("is it true that")
          .setMaxOutputLength(50)
          .setDoSample(True)
          .setInputCols(["documents"])
          .setOutputCol("generation")
      )
  
      pipeline = Pipeline().setStages([document_assembler, gpt2])
      results = pipeline.fit(data).transform(data)
  
      results.select("generation.result").show(truncate=False)
  
file_path: spark-nlp/python/test/annotator/seq2seq/gpt2_transformer_text_generation_test.py
imports: import unittest
  import pytest
  from sparknlp.annotator import *
  from sparknlp.base import *
  from test.util import SparkContextForTest
label_desc: Use image node_id 2 for calling the GPT2TransformerTextGenerationTestSpec obj's underlying member method code with example usage: obj.runTest() without return types