From 033ef80e4e721cd980bf3e0c4f0c112bab2dd603 Mon Sep 17 00:00:00 2001
From: zhifu gao <zhifu.gzf@alibaba-inc.com>
Date: 星期一, 24 四月 2023 11:17:24 +0800
Subject: [PATCH] Merge pull request #405 from alibaba-damo-academy/dev_aky

---
 funasr/bin/tp_inference.py |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/funasr/bin/tp_inference.py b/funasr/bin/tp_inference.py
index 6360b17..df029fd 100644
--- a/funasr/bin/tp_inference.py
+++ b/funasr/bin/tp_inference.py
@@ -54,7 +54,7 @@
         assert check_argument_types()
         # 1. Build ASR model
         tp_model, tp_train_args = ASRTask.build_model_from_file(
-            timestamp_infer_config, timestamp_model_file, device
+            timestamp_infer_config, timestamp_model_file, device=device
         )
         if 'cuda' in device:
             tp_model = tp_model.cuda()  # force model to cuda
@@ -179,6 +179,9 @@
         **kwargs,
 ):
     assert check_argument_types()
+    ncpu = kwargs.get("ncpu", 1)
+    torch.set_num_threads(ncpu)
+    
     if batch_size > 1:
         raise NotImplementedError("batch decoding is not implemented")
     if ngpu > 1:

--
Gitblit v1.9.1