From 0270f62addd6ea7f6141584e2782c6cd751ce1fd Mon Sep 17 00:00:00 2001
From: haoneng.lhn <haoneng.lhn@alibaba-inc.com>
Date: 星期三, 02 八月 2023 10:50:23 +0800
Subject: [PATCH] fix uniasr finetune bug
---
funasr/bin/asr_inference_launch.py | 5 ++---
1 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/funasr/bin/asr_inference_launch.py b/funasr/bin/asr_inference_launch.py
index 10f8e50..dda2879 100644
--- a/funasr/bin/asr_inference_launch.py
+++ b/funasr/bin/asr_inference_launch.py
@@ -260,8 +260,6 @@
hotword_list_or_file = None
clas_scale = 1.0
- if kwargs.get("device", None) == "cpu":
- ngpu = 0
if ngpu >= 1 and torch.cuda.is_available():
device = "cuda"
else:
@@ -439,6 +437,7 @@
logging.info(rtf_avg)
if writer is not None:
ibest_writer["rtf"]["rtf_avf"] = rtf_avg
+ torch.cuda.empty_cache()
return asr_result_list
return _forward
@@ -730,6 +729,7 @@
ibest_writer["time_stamp"][key] = "{}".format(time_stamp_postprocessed)
logging.info("decoding, utt: {}, predictions: {}".format(key, text_postprocessed_punc))
+ torch.cuda.empty_cache()
return asr_result_list
return _forward
@@ -1327,7 +1327,6 @@
right_context: Number of frames in right context AFTER subsampling.
display_partial_hypotheses: Whether to display partial hypotheses.
"""
- # assert check_argument_types()
if batch_size > 1:
raise NotImplementedError("batch decoding is not implemented")
--
Gitblit v1.9.1