class_docstr: Base class for LLM models
  
  This class handles a few of the checks, as well as the whole prediction
  machinery.
  
  Required attributes are:
  
  - model_name
  - model
  - tokenizer
  - prompt
  - probas_sum_to_1
  - device
  - error_low_prob
  - threshold_low_prob
  - use_caching
class_docstr_tok: ["Base","class","for","LLM","models","This","class","handles","a","few","of","the","checks",",","as","well","as","the","whole","prediction","machinery",".","Required","attributes","are",":","-","model_name","-","model","-","tokenizer","-","prompt","-","probas_sum_to_1","-","device","-","error_low_prob","-","threshold_low_prob","-","use_caching"]
code: def __repr__(self):
      # The issue is that the repr for the transformer model can be quite huge
      # and the repr for the tokenizer quite ugly. We solve this by
      # temporarily replacing them by their class names. We should, however,
      # not completely rewrite the repr code because sklearn does some special
      # magic with the repr. This is why super().__repr__() should be used.
      if (self.model is None) and (self.tokenizer is None):
          # the user initialized the class with model name, the repr should be
          # fine
          return super().__repr__()
  
      model_prev = self.model
      tokenizer_prev = self.tokenizer
      rep = None
  
      # we are very defensive, making sure to restore the temporarily made
      # change in case of an error
      try:
          self.model = self.model.__class__.__name__
          self.tokenizer = self.tokenizer.__class__.__name__
          rep = super().__repr__()
      finally:
          self.model = model_prev
          self.tokenizer = tokenizer_prev
  
      if rep is None:
          # if the repr could not be generated, fall back to using the ugly
          # repr
          rep = super().__repr__()
  
      return rep
  
imports: import importlib
  import warnings
  from string import Formatter
  import numpy
  import torch
  from sklearn.base import BaseEstimator, ClassifierMixin
  from sklearn.utils import check_random_state
  from sklearn.utils.validation import check_is_fitted
  from transformers import AutoConfig, AutoTokenizer, LogitsProcessor
  from skorch.exceptions import LowProbabilityError
  from skorch.llm.prompts import DEFAULT_PROMPT_FEW_SHOT, DEFAULT_PROMPT_ZERO_SHOT, DELIM
label_desc: Use image node_id 16 for calling the _LlmBase obj's underlying member method code with example usage: obj.__repr__() and returns: rep, super