From 35b1c051f6db3649a818547902497d219c871b84 Mon Sep 17 00:00:00 2001
From: zhifu gao <zhifu.gzf@alibaba-inc.com>
Date: 星期四, 14 三月 2024 09:33:30 +0800
Subject: [PATCH] Dev gzf llm (#1493)

---
 runtime/python/onnxruntime/funasr_onnx/punc_bin.py |   12 ++++--------
 1 files changed, 4 insertions(+), 8 deletions(-)

diff --git a/runtime/python/onnxruntime/funasr_onnx/punc_bin.py b/runtime/python/onnxruntime/funasr_onnx/punc_bin.py
index 1b8a1a2..db45baa 100644
--- a/runtime/python/onnxruntime/funasr_onnx/punc_bin.py
+++ b/runtime/python/onnxruntime/funasr_onnx/punc_bin.py
@@ -26,6 +26,7 @@
                  quantize: bool = False,
                  intra_op_num_threads: int = 4,
                  cache_dir: str = None,
+                 **kwargs
                  ):
     
         if not Path(model_dir).exists():
@@ -56,7 +57,7 @@
                       "\npip3 install -U funasr -i https://mirror.sjtu.edu.cn/pypi/web/simple"
 
             model = AutoModel(model=model_dir)
-            model_dir = model.export(quantize=quantize)
+            model_dir = model.export(type="onnx", quantize=quantize, **kwargs)
             
         config_file = os.path.join(model_dir, 'config.yaml')
         config = read_yaml(config_file)
@@ -168,14 +169,9 @@
     CT-Transformer: Controllable time-delay transformer for real-time punctuation prediction and disfluency detection
     https://arxiv.org/pdf/2003.01309.pdf
     """
-    def __init__(self, model_dir: Union[str, Path] = None,
-                 batch_size: int = 1,
-                 device_id: Union[str, int] = "-1",
-                 quantize: bool = False,
-                 intra_op_num_threads: int = 4,
-                 cache_dir: str = None
+    def __init__(self, *args, **kwargs
                  ):
-        super().__init__(model_dir, batch_size, device_id, quantize, intra_op_num_threads, cache_dir=cache_dir)
+        super().__init__(*args, **kwargs)
 
     def __call__(self, text: str, param_dict: map, split_size=20):
         cache_key = "cache"

--
Gitblit v1.9.1