docstr: Padding messes with the likelihood computation. Will do 1 by 1 for now.
docstr_tok: ["Padding","messes","with","the","likelihood","computation",".","Will","do","1","by","1","for","now","."]
code: def get_conditional_loglikelihood_batch(
      self,
      texts: list,
      completion_offset: torch.Tensor,
      tokens_to_explain: list = [],
      progress_bar=None,
  ):
      """Padding messes with the likelihood computation. Will do 1 by 1 for now."""
      if progress_bar is None:
          progress_bar = tqdm
      ll_mean_all = []
      ll_total_all = []
      for i in progress_bar(range(len(texts))):
          llm, llt = self.get_conditional_loglikelihood(
              texts[i : i + 1], completion_offset[i : i + 1]
          )
          ll_mean_all.append(llm)
          ll_total_all.append(llt)
      return ll_mean_all, np.concatenate(ll_total_all, axis=0)
  
file_path: interpret-text/python/interpret_text/generative/model_lib/hf_tooling.py
imports: import torch
  import numpy
  from tqdm import tqdm
  import torch.nn.functional
  from scipy.special import log_softmax, logsumexp
label_desc: Use image node_id 4 for calling the HF_LM obj's underlying member method code with example usage: obj.get_conditional_loglikelihood_batch(texts, completion_offset, tokens_to_explain, progress_bar) and returns: ll_mean_all,  np