This repository has been archived on 2025-08-26. You can view files and clone it, but cannot push or open issues or pull requests.
Files
enginex-mr_series-sherpa-onnx/sherpa-onnx/python/tests/test_online_transducer_model_config.py
Fangjun Kuang 79c2ce5dd4 Refactor online recognizer (#250)
* Refactor online recognizer.

Make it easier to support other streaming models.

Note that it is a breaking change for the Python API.
`sherpa_onnx.OnlineRecognizer()` used before should be
replaced by `sherpa_onnx.OnlineRecognizer.from_transducer()`.
2023-08-09 20:27:31 +08:00

29 lines
772 B
Python

# sherpa-onnx/python/tests/test_online_transducer_model_config.py
#
# Copyright (c) 2023 Xiaomi Corporation
#
# To run this single test, use
#
# ctest --verbose -R test_online_transducer_model_config_py
import unittest
import _sherpa_onnx
class TestOnlineTransducerModelConfig(unittest.TestCase):
def test_constructor(self):
config = _sherpa_onnx.OnlineTransducerModelConfig(
encoder="encoder.onnx",
decoder="decoder.onnx",
joiner="joiner.onnx",
)
assert config.encoder == "encoder.onnx", config.encoder
assert config.decoder == "decoder.onnx", config.decoder
assert config.joiner == "joiner.onnx", config.joiner
print(config)
if __name__ == "__main__":
unittest.main()