code: def test_inference(tmp_path: Path, lm_config_file, text_file):
      kwargs = dict(
          output_dir=str(tmp_path / "decode"),
          maxlen=5,
          minlen=1,
          batch_size=1,
          dtype="float32",
          beam_size=1,
          ngpu=0,
          seed=0,
          ngram_weight=0.0,
          penalty=0.0,
          nbest=1,
          num_workers=1,
          log_level="INFO",
          data_path_and_name_and_type=[
              (str(text_file), "text", "text")
          ],
          key_file=None,
          lm_train_config=str(lm_config_file),
          lm_file=None,
          word_lm_train_config=None,
          word_lm_file=None,
          ngram_file=None,
          model_tag=None,
          token_type=None,
          bpemodel=None,
          allow_variable_data_keys=False,
          quantize_lm=False,
          quantize_modules=["Linear"],
          quantize_dtype="int8",
      )
      inference(**kwargs)
  
file_path: espnet/test/espnet2/bin/test_lm_inference.py
imports: import string
  from argparse import ArgumentParser
  from pathlib import Path
  import numpy
  import pytest
  from espnet2.bin.lm_inference import GenerateText, get_parser, inference, main
  from espnet2.tasks.lm import LMTask
  from espnet.nets.beam_search import Hypothesis
label_desc: Use image node_id 9 for calling a global function with example usage: test_inference(tmp_path, lm_config_file, text_file) without return types