code: def test_rescorerbuilder(tmpdir, device):
      import torch
      from sentencepiece import SentencePieceProcessor
      from speechbrain.lobes.models.RNNLM import RNNLM
      from speechbrain.utils.parameter_transfer import Pretrainer
  
      source = "speechbrain/asr-crdnn-rnnlm-librispeech"
      lm_model_path = source + "/lm.ckpt"
      tokenizer_path = source + "/tokenizer.ckpt"
  
      # Define your tokenizer and RNNLM from the HF hub
      tokenizer = SentencePieceProcessor()
      lm_model = RNNLM(
          output_neurons=1000,
          embedding_dim=128,
          activation=torch.nn.LeakyReLU,
          dropout=0.0,
          rnn_layers=2,
          rnn_neurons=2048,
          dnn_blocks=1,
          dnn_neurons=512,
          return_hidden=True,
      )
  
      pretrainer = Pretrainer(
          collect_in=tmpdir,
          loadables={"lm": lm_model, "tokenizer": tokenizer},
          paths={"lm": lm_model_path, "tokenizer": tokenizer_path},
      )
  
      pretrainer.collect_files()
      pretrainer.load_collected()
  
      from speechbrain.decoders.scorer import (
          RNNLMRescorer,
          RescorerBuilder,
          HuggingFaceLMRescorer,
      )
  
      rnnlm_rescorer = RNNLMRescorer(
          language_model=lm_model,
          tokenizer=tokenizer,
          temperature=1.0,
          bos_index=0,
          eos_index=0,
          pad_index=0,
      )
  
      source = "gpt2-medium"
  
      huggingfacelm_rescorer = HuggingFaceLMRescorer(
          model_name=source,
      )
  
      # check combine both rescorers
      rescorer = RescorerBuilder(
          rescorers=[rnnlm_rescorer, huggingfacelm_rescorer],
          weights={"rnnlm": 1.0, "huggingfacelm": 1.0},
      )
      rescorer.move_rescorers_to_device(device)
      # check lm is on the right device
      assert (
          rnnlm_rescorer.lm.parameters().__next__().device.type
          == device
      )
      assert huggingfacelm_rescorer.lm.device.type == device
  
      # Topk hypotheses
      topk_hyps = [["HELLO", "HE LLO", "H E L L O"]]
      topk_scores = [[-2, -2, -2]]
      rescored_hyps, rescored_scores = rescorer.rescore(
          topk_hyps, topk_scores
      )
  
      # check all hyps are still there
      for hyp in topk_hyps[0]:
          assert hyp in rescored_hyps[0]
  
      # check rescored_scores are sorted
      for i in range(len(rescored_scores[0]) - 1):
          assert rescored_scores[0][i] >= rescored_scores[0][i + 1]
  
label_desc: Use image node_id 4 for calling a global function with example usage: test_rescorerbuilder(tmpdir, device) without return types