code: def test_model_consistency(tmp_path: Path):
      url = "https://github.com/microsoft/DNS-Challenge/raw/master/DNSMOS/DNSMOS/sig_bak_ovr.onnx"  # noqa: E501
      urllib.request.urlretrieve(
          url, str(tmp_path / "sig_bak_ovr.onnx")
      )
      url = "https://github.com/microsoft/DNS-Challenge/raw/master/DNSMOS/DNSMOS/model_v8.onnx"  # noqa: E501
      urllib.request.urlretrieve(url, str(tmp_path / "model_v8.onnx"))
  
      dnsmos_th = DNSMOS_local(
          tmp_path / "sig_bak_ovr.onnx",
          tmp_path / "model_v8.onnx",
          use_gpu=False,
          convert_to_torch=True,
      )
      dnsmos_onnx = DNSMOS_local(
          tmp_path / "sig_bak_ovr.onnx",
          tmp_path / "model_v8.onnx",
          use_gpu=False,
          convert_to_torch=False,
      )
      fs = 32000
      speech = torch.randn(fs // 2)
      ret_th = dnsmos_th(speech.numpy(), fs)
      ret_onnx = dnsmos_onnx(speech, fs)
      for k in ret_th.keys():
          np.testing.assert_allclose(ret_th[k], ret_onnx[k])
  
file_path: espnet/test/espnet2/enh/layers/test_dnsmos.py
imports: import urllib.request
  from pathlib import Path
  import numpy
  import pytest
  import torch
  from espnet2.enh.layers.dnsmos import DNSMOS_local
label_desc: Use image node_id 3 for calling a global function with example usage: test_model_consistency(tmp_path) without return types