class_docstr: Seq2Seq language modeling.
  You can find a set of supported models in the following documentation:
  https://huggingface.co/docs/transformers/main/model_doc/auto#transformers.AutoModelForSeq2SeqLM
class_docstr_tok: ["Seq2Seq","language","modeling",".","You","can","find","a","set","of","supported","models","in","the","following","documentation",":","https",":","\/\/huggingface.co\/docs\/transformers\/main\/model_doc\/auto","#","transformers.AutoModelForSeq2SeqLM"]
code: def loglikelihood_rolling(
      self, requests: List[Tuple[str, str]]
  ) -> List[float]:
      loglikelihoods = []
      for (string,) in tqdm(requests):
          rolling_token_windows = list(
              map(
                  utils.make_disjoint_window,
                  utils.get_rolling_token_windows(
                      token_list=self.tok_encode(string),
                      prefix_token=self.eot_token_id,
                      max_seq_len=self.max_length,
                      context_len=1,
                  ),
              )
          )
          contexts, conts = utils.split_and_pad_windows(
              rolling_token_windows,
              pad_token_id=self.eot_token_id,
              max_seq_len=self.max_length,
          )
          # Manually create BatchEncoding tensors with attention masks as
          # expected by `self._model_call` in `self._loglikelihood_tokens`.
          contexts_enc = torch.Tensor(contexts).long()
          contexts_enc = (
              transformers.tokenization_utils_base.BatchEncoding(
                  {
                      "input_ids": contexts_enc,
                      "attention_mask": (
                          contexts_enc != self.eot_token_id
                      ).long(),
                  }
              )
          )
          conts_enc = torch.Tensor(conts).long()
          conts_enc = (
              transformers.tokenization_utils_base.BatchEncoding(
                  {
                      "input_ids": conts_enc,
                      "attention_mask": (
                          conts_enc != self.eot_token_id
                      ).long(),
                  }
              )
          )
          # TODO: Extract out this call so it only gets called once and also
          # somehow figure out partial caching for.
          rolling_token_windows_request = [
              ((contexts, conts), contexts_enc, conts_enc)
          ]
          string_nll = self._loglikelihood_tokens(
              rolling_token_windows_request, disable_tqdm=True
          )
          string_nll = [x[0] for x in string_nll]  # discard is_greedy
          string_nll = sum(string_nll)
          loglikelihoods.append(string_nll)
      return loglikelihoods
  
imports: import math
  import torch
  import torch.nn.functional
  import transformers
  import peft
  from pathlib import Path
  from typing import List, Mapping, NewType, Optional, Tuple, Union
  from tqdm import tqdm
  from transformers import BatchEncoding
  from lm_eval import utils
  from lm_eval.base import BaseLM
label_desc: Use image node_id 3 for calling the AutoSeq2SeqLM obj's underlying member method code with example usage: obj.loglikelihood_rolling(requests) and returns: loglikelihoods