From 602fe75a1f0a8d64ccb6fc4d69ad510872fdfd13 Mon Sep 17 00:00:00 2001
From: 游雁 <zhifu.gzf@alibaba-inc.com>
Date: 星期五, 17 三月 2023 20:30:40 +0800
Subject: [PATCH] rtf benchmark

---
 funasr/runtime/python/libtorch/torch_paraformer/paraformer_bin.py |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/funasr/runtime/python/libtorch/torch_paraformer/paraformer_bin.py b/funasr/runtime/python/libtorch/torch_paraformer/paraformer_bin.py
index 3545ccf..d47135a 100644
--- a/funasr/runtime/python/libtorch/torch_paraformer/paraformer_bin.py
+++ b/funasr/runtime/python/libtorch/torch_paraformer/paraformer_bin.py
@@ -24,12 +24,16 @@
                  device_id: Union[str, int] = "-1",
                  plot_timestamp_to: str = "",
                  pred_bias: int = 1,
+                 quantize: bool = False,
+                 intra_op_num_threads: int = 1,
                  ):
 
         if not Path(model_dir).exists():
             raise FileNotFoundError(f'{model_dir} does not exist.')
 
         model_file = os.path.join(model_dir, 'model.torchscripts')
+        if quantize:
+            model_file = os.path.join(model_dir, 'model_quant.torchscripts')
         config_file = os.path.join(model_dir, 'config.yaml')
         cmvn_file = os.path.join(model_dir, 'am.mvn')
         config = read_yaml(config_file)

--
Gitblit v1.9.1