code: def __init__(self):
      super(DeepSpeech2, self).__init__()
  
      # resource
      res_dir = os.path.join(
          MODULE_HOME, "deepspeech2_librispeech", "assets"
      )
      conf_file = os.path.join(res_dir, "conf/deepspeech2.yaml")
      checkpoint = os.path.join(res_dir, "checkpoints/avg_1.pdparams")
      # Download LM manually cause its large size.
      lm_path = os.path.join(res_dir, "data", "lm")
      lm_file = os.path.join(lm_path, LM_URL.split("/")[-1])
      if not os.path.isfile(lm_file):
          logger.info(f"Downloading lm from {LM_URL}.")
          get_path_from_url(url=LM_URL, root_dir=lm_path, md5sum=LM_MD5)
  
      # config
      self.model_type = "offline"
      self.config = get_cfg_defaults(self.model_type)
      self.config.merge_from_file(conf_file)
  
      # TODO: Remove path updating snippet.
      with UpdateConfig(self.config):
          self.config.collator.mean_std_filepath = os.path.join(
              res_dir, self.config.collator.mean_std_filepath
          )
          self.config.collator.vocab_filepath = os.path.join(
              res_dir, self.config.collator.vocab_filepath
          )
          self.config.collator.augmentation_config = os.path.join(
              res_dir, self.config.collator.augmentation_config
          )
          self.config.decoding.lang_model_path = os.path.join(
              res_dir, self.config.decoding.lang_model_path
          )
  
      # model
      self.tester = DeepSpeech2Tester(self.config)
      self.tester.setup_model()
      self.tester.resume(checkpoint)
  
file_path: PaddleHub/modules/audio/asr/deepspeech2_librispeech/module.py
imports: import os
  from pathlib import Path
  import sys
  import numpy
  from paddlehub.env import MODULE_HOME
  from paddlehub.module.module import moduleinfo, serving
  from paddlehub.utils.log import logger
  from paddle.utils.download import get_path_from_url
  import paddle
  import soundfile
  from deepspeech.exps.deepspeech2.config import get_cfg_defaults
  from deepspeech.utils.utility import UpdateConfig
  from .deepspeech_tester import DeepSpeech2Tester
label_desc: Use image node_id 1 to create a new DeepSpeech2 object from inherited base classes: paddle.nn with example: obj = DeepSpeech2()