docstr: The function takes in a list of strings and returns a list of predictions
  
  Args:
    text (Union[List[str], str]): The text to be classified.
    as_argilla_records (bool): If True, the prediction will be returned as an Argilla record. If
  False, the prediction will be returned as a string. Defaults to True
  
  Returns:
    A list of predictions
docstr_tok: ["The","function","takes","in","a","list","of","strings","and","returns","a","list","of","predictions","Args",":","text","(","Union","[","List","[","str","]",",","str","]",")",":","The","text","to","be","classified",".","as_argilla_records","(","bool",")",":","If","True",",","the","prediction","will","be","returned","as","an","Argilla","record",".","If","False",",","the","prediction","will","be","returned","as","a","string",".","Defaults","to","True","Returns",":","A","list","of","predictions"]
code: def predict(
      self,
      text: Union[List[str], str],
      as_argilla_records: bool = True,
      **kwargs,
  ):
      """
      The function takes in a list of strings and returns a list of predictions
  
      Args:
        text (Union[List[str], str]): The text to be classified.
        as_argilla_records (bool): If True, the prediction will be returned as an Argilla record. If
      False, the prediction will be returned as a string. Defaults to True
  
      Returns:
        A list of predictions
      """
      if self.trainer_model is None:
          self._logger.warning("Using model without fine-tuning.")
          self.init_model()
  
      str_input = False
      if isinstance(text, str):
          text = [text]
          str_input = True
  
      predictions = self.trainer_model.predict_proba(text, **kwargs)
  
      formatted_prediction = []
      for val, pred in zip(text, predictions):
          pred = {
              self._id2label[idx]: float(p)
              for idx, p in enumerate(pred)
          }
          if as_argilla_records:
              pred = self._record_class(
                  text=val,
                  prediction=[(k, v) for k, v in pred.items()],
                  multi_label=self._multi_label,
              )
          formatted_prediction.append(pred)
  
      if str_input:
          formatted_prediction = formatted_prediction[0]
      return formatted_prediction
  
file_path: argilla/src/argilla/training/setfit.py
imports: import json
  import logging
  from typing import List, Union
  from argilla.client.models import TextClassificationRecord
  from argilla.training.transformers import ArgillaTransformersTrainer
  from argilla.training.utils import get_default_args
  from argilla.utils.dependency import require_dependencies
label_desc: Use image node_id 7 for calling the ArgillaSetFitTrainer obj's underlying member method code with example usage: obj.predict(text, as_argilla_records) and returns: formatted_prediction