class_docstr: A user facing class for text to text generation
class_docstr_tok: ["A","user","facing","class","for","text","to","text","generation"]
code: def generate_text(
      self, text: str, args: TTSettings = TTSettings()
  ) -> TextToTextResult:
      # loads pipeline if it hasn't been loaded already.
      self._load_pipeline()
  
      self.__assert_default_text_is_val(text)
  
      output = self._pipeline(
          text,
          min_length=args.min_length,
          max_length=args.max_length,
          do_sample=args.do_sample,
          early_stopping=args.early_stopping,
          num_beams=args.num_beams,
          temperature=args.temperature,
          top_k=args.top_k,
          no_repeat_ngram_size=args.no_repeat_ngram_size,
          top_p=args.top_p,
      )
      return TextToTextResult(text=output[0]["generated_text"])
  
file_path: happy-transformer/happytransformer/happy_text_to_text.py
imports: from dataclasses import dataclass
  from typing import Union
  from datasets import Dataset
  from transformers import AutoModelForSeq2SeqLM, DataCollatorForSeq2Seq, Text2TextGenerationPipeline
  from happytransformer.adaptors import get_adaptor
  from happytransformer.args import TTEvalArgs, TTTestArgs, TTTrainArgs
  from happytransformer.fine_tuning_util import EvalResult
  from happytransformer.happy_transformer import HappyTransformer
label_desc: Use image node_id 3 for calling the HappyTextToText obj's underlying member method code with example usage: obj.generate_text(text, args) and returns: TextToTextResult