From cfc4d402093060fe087424b0a6be4e2b2546eae8 Mon Sep 17 00:00:00 2001
From: wanchen.swc <wanchen.swc@alibaba-inc.com>
Date: 星期四, 30 三月 2023 18:15:15 +0800
Subject: [PATCH] [Export] support gpu inference

---
 funasr/runtime/python/libtorch/demo.py |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/funasr/runtime/python/libtorch/demo.py b/funasr/runtime/python/libtorch/demo.py
index 58285a7..b2b65ac 100644
--- a/funasr/runtime/python/libtorch/demo.py
+++ b/funasr/runtime/python/libtorch/demo.py
@@ -2,9 +2,9 @@
 from funasr_torch import Paraformer
 
 model_dir = "/nfs/zhifu.gzf/export/damo/speech_paraformer-large_asr_nat-zh-cn-16k-common-vocab8404-pytorch"
-model = Paraformer(model_dir, batch_size=1)
+model = Paraformer(model_dir, batch_size=1, device_id=0)
 
 wav_path = ['/nfs/zhifu.gzf/export/damo/speech_paraformer-large_asr_nat-zh-cn-16k-common-vocab8404-pytorch/example/asr_example.wav']
 
 result = model(wav_path)
-print(result)
\ No newline at end of file
+print(result)

--
Gitblit v1.9.1