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"]
docstr: Return the unnormalized y_proba
  
  Warns if the total probability for a sample is below the threshold and
  ``error_low_prob`` is ``'warn'``.
docstr_tok: ["Return","the","unnormalized","y_proba","Warns","if","the","total","probability","for","a","sample","is","below","the","threshold","and","``","error_low_prob","``","is","``","'warn","'","``","."]
code: def _predict_proba(self, X):
      """Return the unnormalized y_proba
  
      Warns if the total probability for a sample is below the threshold and
      ``error_low_prob`` is ``'warn'``.
  
      """
      self.check_is_fitted()
      y_proba = []
      for xi in X:
          text = self.get_prompt(xi)
          proba = self._predict_one(text)
          y_proba.append(proba)
      y_proba = np.vstack(y_proba)
  
      if self.error_low_prob == "warn":
          total_low_probas = (
              y_proba.sum(1) < self.threshold_low_prob
          ).sum()
          if total_low_probas:
              warnings.warn(
                  f"Found {total_low_probas} samples to have a total probability "
                  f"below the threshold of {self.threshold_low_prob:.3f}."
              )
  
      return y_proba
  
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 12 for calling the _LlmBase obj's underlying member method code with example usage: obj._predict_proba(X) and returns: y_proba