class_docstr: Hugging Face Transformers Decoder.
  
  Args:
      encoder_output_size: dimension of encoder attention
      model_name_or_path: Hugging Face Transformers model name
class_docstr_tok: ["Hugging","Face","Transformers","Decoder",".","Args",":","encoder_output_size",":","dimension","of","encoder","attention","model_name_or_path",":","Hugging","Face","Transformers","model","name"]
code: def batch_score(
      self,
      ys: torch.Tensor,
      states: List[Any],
      xs: torch.Tensor,
      speech: torch.Tensor = None,
  ) -> Tuple[torch.Tensor, List[Any]]:
      # import pdb;pdb.set_trace()
      model_kwargs = {
          "encoder_outputs": ModelOutput(
              last_hidden_state=self.linear_in(xs)
          ),
      }
      model_inputs = self.hf_generate.prepare_inputs_for_generation(
          ys, **model_kwargs
      )
      outputs = self.hf_generate(
          **model_inputs,
          return_dict=True,
          output_attentions=False,
          output_hidden_states=False,
      )
      next_token_logits = outputs.logits[:, -1, :]
      next_token_scores = torch.nn.functional.log_softmax(
          next_token_logits, dim=-1
      )  # (batch_size * num_beams, vocab_size)
      return next_token_scores, None
  
file_path: espnet/espnet2/asr/decoder/hugging_face_transformers_decoder.py
imports: import copy
  import logging
  from typing import Any, List, Tuple
  import torch
  import torch.nn.functional
  from typeguard import check_argument_types
  from espnet2.asr.decoder.abs_decoder import AbsDecoder
  from espnet.nets.pytorch_backend.nets_utils import make_pad_mask
  from espnet.nets.scorer_interface import BatchScorerInterface
label_desc: Use image node_id 6 for calling the HuggingFaceTransformersDecoder obj's underlying member method code with example usage: obj.batch_score(ys, states, xs, speech) and returns: next_token_scores,  None