From ed25726d2992f8a395a8d4ed9bd5e85d231c471e Mon Sep 17 00:00:00 2001
From: root <root@localhost.localdomain>
Date: 星期五, 28 四月 2023 17:00:56 +0800
Subject: [PATCH] add offline websocket support
---
funasr/bin/asr_inference_paraformer.py | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/funasr/bin/asr_inference_paraformer.py b/funasr/bin/asr_inference_paraformer.py
index a8ac99d..5546c92 100644
--- a/funasr/bin/asr_inference_paraformer.py
+++ b/funasr/bin/asr_inference_paraformer.py
@@ -631,7 +631,9 @@
export_mode = param_dict.get("export_mode", False)
else:
hotword_list_or_file = None
-
+
+ if kwargs.get("device", None) == "cpu":
+ ngpu = 0
if ngpu >= 1 and torch.cuda.is_available():
device = "cuda"
else:
--
Gitblit v1.9.1