class_docstr: Online beam search implementation.
  
  This simulates streaming decoding.
  It requires encoded features of entire utterance and
  extracts block by block from it as it shoud be done
  in streaming processing.
  This is based on Tsunoo et al, "STREAMING TRANSFORMER ASR
  WITH BLOCKWISE SYNCHRONOUS BEAM SEARCH"
  (https://arxiv.org/abs/2006.14941).
docstr: Set config file for streaming decoding.
  
  Args:
      asr_config (str): The config file for asr training
docstr_tok: ["Set","config","file","for","streaming","decoding",".","Args",":","asr_config","(","str",")",":","The","config","file","for","asr","training"]
code: def set_streaming_config(self, asr_config: str):
      """Set config file for streaming decoding.
  
      Args:
          asr_config (str): The config file for asr training
  
      """
      train_config_file = Path(asr_config)
      self.block_size = None
      self.hop_size = None
      self.look_ahead = None
      config = None
      with train_config_file.open("r", encoding="utf-8") as f:
          args = yaml.safe_load(f)
          if "encoder_conf" in args.keys():
              if "block_size" in args["encoder_conf"].keys():
                  self.block_size = args["encoder_conf"]["block_size"]
              if "hop_size" in args["encoder_conf"].keys():
                  self.hop_size = args["encoder_conf"]["hop_size"]
              if "look_ahead" in args["encoder_conf"].keys():
                  self.look_ahead = args["encoder_conf"]["look_ahead"]
          elif "config" in args.keys():
              config = args["config"]
              if config is None:
                  logging.info(
                      "Cannot find config file for streaming decoding: "
                      + "apply batch beam search instead."
                  )
                  return
      if (
          self.block_size is None
          or self.hop_size is None
          or self.look_ahead is None
      ) and config is not None:
          config_file = Path(config)
          with config_file.open("r", encoding="utf-8") as f:
              args = yaml.safe_load(f)
          if "encoder_conf" in args.keys():
              enc_args = args["encoder_conf"]
          if enc_args and "block_size" in enc_args:
              self.block_size = enc_args["block_size"]
          if enc_args and "hop_size" in enc_args:
              self.hop_size = enc_args["hop_size"]
          if enc_args and "look_ahead" in enc_args:
              self.look_ahead = enc_args["look_ahead"]
  
file_path: espnet/espnet/nets/batch_beam_search_online_sim.py
imports: import logging
  from pathlib import Path
  from typing import List
  import torch
  import yaml
  from espnet.nets.batch_beam_search import BatchBeamSearch
  from espnet.nets.beam_search import Hypothesis
  from espnet.nets.e2e_asr_common import end_detect
label_desc: Use image node_id 1 for calling the BatchBeamSearchOnlineSim obj's underlying member method code with example usage: obj.set_streaming_config(asr_config) without return types