code: def text_completion(
      self,
      prompts: List[str],
      temperature: float = 0.6,
      top_p: float = 0.9,
      max_gen_len: Optional[int] = None,
      logprobs: bool = False,
      echo: bool = False,
  ) -> List[CompletionPrediction]:
      if max_gen_len is None:
          max_gen_len = self.model.params.max_seq_len - 1
      prompt_tokens = [
          self.tokenizer.encode(x, bos=True, eos=False) for x in prompts
      ]
      generation_tokens, generation_logprobs = self.generate(
          prompt_tokens=prompt_tokens,
          max_gen_len=max_gen_len,
          temperature=temperature,
          top_p=top_p,
          logprobs=logprobs,
          echo=echo,
      )
      if logprobs:
          return [
              {
                  "generation": self.tokenizer.decode(t),
                  "tokens": [self.tokenizer.decode(x) for x in t],
                  "logprobs": logprobs_i,
              }
              for t, logprobs_i in zip(
                  generation_tokens, generation_logprobs
              )
          ]
      return [
          {"generation": self.tokenizer.decode(t)}
          for t in generation_tokens
      ]
  
imports: import json
  import os
  import sys
  import time
  from pathlib import Path
  from typing import List, Literal, Optional, Tuple, TypedDict
  import torch
  import torch.nn.functional
  from fairscale.nn.model_parallel.initialize import get_model_parallel_rank, initialize_model_parallel, model_parallel_is_initialized
  from llama.model import ModelArgs, Transformer
  from llama.tokenizer import Tokenizer
label_desc: Use image node_id 4 for calling the Llama obj's underlying member method code with example usage: obj.text_completion(prompts, temperature, top_p, max_gen_len, logprobs, echo) and returns: unknown, unknown