class_docstr: Stores the data, status, and block information of a sequence.
  
  Args:
      seq_id: The ID of the sequence.
      prompt: The prompt of the sequence.
      prompt_token_ids: The token IDs of the prompt.
class_docstr_tok: ["Stores","the","data",",","status",",","and","block","information","of","a","sequence",".","Args",":","seq_id",":","The","ID","of","the","sequence",".","prompt",":","The","prompt","of","the","sequence",".","prompt_token_ids",":","The","token","IDs","of","the","prompt","."]
docstr: Calculate the beam search score with length penalty.
  
  Adapted from
  
  https://github.com/huggingface/transformers/blob/ccb92be23def445f2afdea94c31286f84b89eb5b/src/transformers/generation/beam_search.py#L938
code: def get_beam_search_score(
      self,
      length_penalty: float = 0.0,
      seq_len: Optional[int] = None,
      eos_token_id: Optional[int] = None,
  ) -> float:
      """Calculate the beam search score with length penalty.
  
      Adapted from
  
      https://github.com/huggingface/transformers/blob/ccb92be23def445f2afdea94c31286f84b89eb5b/src/transformers/generation/beam_search.py#L938
      """
      if seq_len is None:
          seq_len = self.get_len()
          # Note: HF implementation does not count the EOS token
          # towards the length, we align with that here for testing.
          if (
              eos_token_id is not None
              and self.get_last_token_id() == eos_token_id
          ):
              seq_len -= 1
      return self.get_cumulative_logprob() / (seq_len**length_penalty)
  
imports: import copy
  import enum
  import time
  from typing import Dict, List, Optional, Union
  from bigdl.llm.vllm.sampling_params import SamplingParams
  from bigdl.llm.utils.common import invalidInputError
label_desc: Use image node_id 11 for calling the Sequence obj's underlying member method code with example usage: obj.get_beam_search_score(length_penalty, seq_len, eos_token_id) and returns: unknown