class_docstr: Each `Instance` in a `Scenario` looks like this:
  
      <input> -> <reference1>
                 <reference2>
                 <reference3> [correct]
                 <reference4>
  
  For language modeling, we don't use the references (even if they exist), just feed the input:
  
      <input>
docstr: Some subwords/symbols might translate to multiple tokens. e.g. ’ => ["bytes:â", "bytes:"].
  
  When a subword of this type happens to be the last token of a chunk, we need to strip the leading and
  trailing bytes to ensure the prompt is a valid string.
  
  Since some tokens are removed, we also need to recompute num_conditioning_tokens.
  
  For models using the GPT-2 tokenizer, conditioning_tokens and pred_tokens are integers; for AI21
  models, the tokens are TokenizationTokens.
  
  text is the normalized text fed to decode(). Some tokenizers (e.g. AI21) need this field for decoding.
docstr_tok: ["Some","subwords\/symbols","might","translate","to","multiple","tokens",".","e.g",".","\u2019","=",">","[","``","bytes",":","\u00e2\u0080","''",",","``","bytes",":","\u0099","''","]",".","When","a","subword","of","this","type","happens","to","be","the","last","token","of","a","chunk",",","we","need","to","strip","the","leading","and","trailing","bytes","to","ensure","the","prompt","is","a","valid","string",".","Since","some","tokens","are","removed",",","we","also","need","to","recompute","num_conditioning_tokens",".","For","models","using","the","GPT-2","tokenizer",",","conditioning_tokens","and","pred_tokens","are","integers",";","for","AI21","models",",","the","tokens","are","TokenizationTokens",".","text","is","the","normalized","text","fed","to","decode","(",")",".","Some","tokenizers","(","e.g",".","AI21",")","need","this","field","for","decoding","."]
code: def construct_language_modeling_prompt(
      self,
      conditioning_tokens: List[TokenizationToken],
      pred_tokens: List[TokenizationToken],
      max_req_len: int,
      text: str,
  ) -> Tuple[str, int]:
      """
      Some subwords/symbols might translate to multiple tokens. e.g. ’ => ["bytes:\xe2\x80", "bytes:\x99"].
  
      When a subword of this type happens to be the last token of a chunk, we need to strip the leading and
      trailing bytes to ensure the prompt is a valid string.
  
      Since some tokens are removed, we also need to recompute num_conditioning_tokens.
  
      For models using the GPT-2 tokenizer, conditioning_tokens and pred_tokens are integers; for AI21
      models, the tokens are TokenizationTokens.
  
      text is the normalized text fed to decode(). Some tokenizers (e.g. AI21) need this field for decoding.
      """
      raw_prompt: str
      raw_prompt, pred_tokens = self.fits_tokens_within_context_window(
          conditioning_tokens, pred_tokens, max_req_len, text
      )
  
      prompt: str = raw_prompt.strip("\ufffd")
      # If there are no byte tokens, avoid API calls
      if len(prompt) == len(raw_prompt):
          num_conditioning_tokens = len(conditioning_tokens)
      else:
          num_leading_byte_tokens: int = max_req_len - len(
              self.window_service.encode(
                  raw_prompt.lstrip("\ufffd")
              ).tokens
          )
          num_trailing_byte_tokens: int = max_req_len - len(
              self.window_service.encode(
                  raw_prompt.rstrip("\ufffd")
              ).tokens
          )
  
          # There are no string tokens to predict
          if num_trailing_byte_tokens >= len(pred_tokens):
              num_conditioning_tokens = len(
                  self.window_service.encode(prompt).tokens
              )
          # There are no conditioning string tokens
          elif num_leading_byte_tokens >= len(conditioning_tokens):
              num_conditioning_tokens = 1
          else:
              num_conditioning_tokens = (
                  len(conditioning_tokens) - num_leading_byte_tokens
              )
      return prompt, num_conditioning_tokens
  
file_path: H2O/h2o_hf/helm/src/helm/benchmark/adaptation/adapters/language_modeling_adapter.py
imports: from typing import List, Tuple, Optional
  from helm.benchmark.adaptation.request_state import RequestState
  from helm.benchmark.adaptation.scenario_state import ScenarioState
  from helm.benchmark.scenarios.scenario import Instance, EVAL_SPLITS
  from helm.benchmark.window_services.window_service import EncodeResult
  from helm.common.general import flatten_list, parallel_map
  from helm.common.hierarchical_logger import hlog, htrack
  from helm.common.request import Request
  from helm.common.tokenization_request import TokenizationToken
  from .adapter import Adapter
label_desc: Use image node_id 3 for calling the LanguageModelingAdapter obj's underlying member method code with example usage: obj.construct_language_modeling_prompt(conditioning_tokens, pred_tokens, max_req_len, text) and returns: prompt,  num_conditioning_tokens